std::experimental::ranges::ForwardIterator
| Technical Specification | ||||
| Filesystem library (filesystem TS) | ||||
| Library fundamentals (library fundamentals TS) | ||||
| Library fundamentals 2 (library fundamentals TS v2) | ||||
| Library fundamentals 3 (library fundamentals TS v3) | ||||
| Extensions for parallelism (parallelism TS) | ||||
| Extensions for parallelism 2 (parallelism TS v2) | ||||
| Extensions for concurrency (concurrency TS) | ||||
| Extensions for concurrency 2 (concurrency TS v2) | ||||
| Concepts (concepts TS) | ||||
| Ranges (ranges TS) | ||||
| Reflection (reflection TS) | ||||
| Mathematical special functions (special functions TR) | ||||
| Experimental Non-TS | ||||
| Pattern Matching | ||||
| Linear Algebra | ||||
| std::execution | ||||
| Contracts | ||||
| 2D Graphics |
| Iterator concepts | |||||||||||||||||||||||
|
|||||||||||||||||||||||
| Indirect callable concepts | |||||||||||||||||||||||
| Common algorithm requirements | |||||||||||||||||||||||
| Concept utilities | |||||||||||||||||||||||
| Iterator utilities and operations | |||||||||||||||||||||||
| Iterator traits | |||||||||||||||||||||||
| Iterator adaptors | |||||||||||||||||||||||
| Stream iterators | |||||||||||||||||||||||
Defined in header <experimental/ranges/iterator>
|
||
|
template
<
class I >
concept bool ForwardIterator =
|
(ranges TS) | |
The concept ForwardIterator<I> refines InputIterator by adding equality comparison and the multi-pass guarantee.
The domain of == for forward iterators is that of iterators over the same underlying sequence, except that value-initialized iterators of the same type may be compared with each other and shall compare equal.
Pointers and references obtained from a forward iterator into a range
[
i
,
s
)
must remain valid while
[
i
,
s
)
Let a and b be two dereferenceable iterators of type I. ForwardIterator<I> is satisfied only if:
- a == b implies ++a == ++b
- The expression
(
[
]
(X x)
{
++x;
}
(a), *a)
is equivalent to *a, i.e., incrementing a copy of
ahas no effect on the result of dereferencinga
This is known as the multi-pass guarantee.
Notes
A forward iterator cannot be "stashing": it cannot return a reference to an object within itself, because such references would be invalidated by the destruction of the forward iterator.