Namespaces
Variants
Views
Actions

C++ concepts: ForwardIterator

From cppreference.com
< cpp‎ | concept
Revision as of 05:45, 19 June 2013 by FEZA (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 ForwardIterator, 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