A LegacyForwardIterator is a LegacyIterator that can read data from the pointed-to element.
Unlike LegacyInputIterator and LegacyOutputIterator, it can be used in multipass algorithms.
If a LegacyForwardIterator it originates from a Container, then it's value type is the same as the container's, so dereferencing (*it) obtains the container's value type.
[edit] RequirementsX
satisfies LegacyForwardIterator if all following conditions are satisfied:
X
satisfies LegacyInputIterator.X
satisfies DefaultConstructible.X
is a mutable iterator, Ref
is a reference to T
.X
is a constant iterator, Ref
is a reference to const T.X
provide multi-pass guarantee.Ref
[edit] Equality domain
The domain of == for forward iterators is that of iterators over the same underlying sequence.
However, value-initialized forward iterators can be compared, and must compare equal to other value-initialized iterators of the same type.
In other words, value-initialized forward iterators behave as if they refer past the end of the same empty sequence.
(since C++14) [edit] Multi-pass guaranteeTwo dereferenceable iterators a and b of type X
offer the multi-pass guarantee if all following conditions are satisfied:
X
is a pointer type.For the definition of std::iterator_traits, the following exposition-only concept is defined.
where the exposition-only concept __LegacyInputIterator<T>
is described in LegacyInputIterator.
Unlike the std::forward_iterator concept, the LegacyForwardIterator requirements requires dereference to return a reference.
[edit] Defect reportsThe following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior LWG 1212Ref
LWG 1311
__LegacyForwardIterator
required
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4