Namespaces
Variants
Views
Actions

C++ concepts: ForwardIterator

From cppreference.com
< cpp‎ | concept
Revision as of 07:28, 14 January 2013 by Nate (Talk | contribs)

A ForwardIterator is an Iterator that can read data from the pointed-to element.

Unlike an InputIterator, it guarantees validity when used in multipass algorithms.

Requirements

In addition to the above requirements, for a type It to be an Forwardterator, an instance i of It must:

Expression Return Equivalent expression Notes
++i const It& After this, copies of i are still valid
i++ value_type temp = *i;

++i;

return temp;
*i++ reference

A mutable ForwardIterator is a ForwardIterator that additionally satisfies the OutputIterator requirements.

See also