A LegacyForwardIterator is an LegacyIterator that can read data from the pointed-to element.
Unlike LegacyInputIterator and LegacyOutputIterator, it can be used in multipass algorithms.
The type It satisfies LegacyForwardIterator if.
It satisfies LegacyInputIterator It satisfies DefaultConstructible It provide multipass guarantee described below std::iterator_traits<It>::reference must be exactly T& if It satisfies LegacyOutputIterator (It is mutable) const T& otherwise (It is constant), T is the type denoted by std::iterator_traits<It>::value_type) And, given.
i, dereferenceable iterator of type It reference, the type denoted by std::iterator_traits<It>::reference The following expressions must be valid and have their specified effects.
| Expression | Return type | Equivalent expression | Notes |
|---|---|---|---|
i++ | It | It ip=i; ++i; return ip; | |
*i++ | reference |
A mutable LegacyForwardIterator is a LegacyForwardIterator that additionally satisfies the LegacyOutputIterator requirements.
Given a and b, dereferenceable iterators of type It.
a and b compare equal (a == b is contextually convertible to true) then either they are both non-dereferenceable or *a and *b are references bound to the same object *a and *b refer to the same object, then a == b. ForwardIterator iterator cannot invalidate the iterator (implicit due to reference defined as a true reference) a does not change the value read from a (formally, either It is a raw pointer type or the expression (void)++It(a), *a is equivalent to the expression *a) a == b implies ++a == ++b Singular iteratorsA value-initialized LegacyForwardIterator behaves like the past-the-end iterator of some unspecified empty container: it compares equal to all value-initialized LegacyForwardIterators of the same type. | (since C++14) |
ConceptFor the definition of
where the exposition-only concept | (since C++20) |
specifies that an InputIterator is a forward iterator, supporting equality comparison and multi-pass (concept) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/named_req/ForwardIterator