C++ concepts: ForwardIterator
From cppreference.com
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.
[edit] Requirements
- InputIterator
- DefaultConstructible
- a == b implies ++a == ++b
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; |
||
*i++ | reference |