tmp/tmplss7j8ki/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Concept <a id="iterator.concept.forward">[[iterator.concept.forward]]</a>
|
| 2 |
+
|
| 3 |
+
The `forward_iterator` concept adds copyability, equality comparison,
|
| 4 |
+
and the multi-pass guarantee, specified below.
|
| 5 |
+
|
| 6 |
+
``` cpp
|
| 7 |
+
template<class I>
|
| 8 |
+
concept forward_iterator =
|
| 9 |
+
input_iterator<I> &&
|
| 10 |
+
derived_from<ITER_CONCEPT(I), forward_iterator_tag> &&
|
| 11 |
+
incrementable<I> &&
|
| 12 |
+
sentinel_for<I, I>;
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
The domain of `==` for forward iterators is that of iterators over the
|
| 16 |
+
same underlying sequence. However, value-initialized iterators of the
|
| 17 |
+
same type may be compared and shall compare equal to other
|
| 18 |
+
value-initialized iterators of the same type.
|
| 19 |
+
|
| 20 |
+
[*Note 1*: Value-initialized iterators behave as if they refer past the
|
| 21 |
+
end of the same empty sequence. — *end note*]
|
| 22 |
+
|
| 23 |
+
Pointers and references obtained from a forward iterator into a range
|
| 24 |
+
\[`i`, `s`) shall remain valid while \[`i`, `s`) continues to denote a
|
| 25 |
+
range.
|
| 26 |
+
|
| 27 |
+
Two dereferenceable iterators `a` and `b` of type `X` offer the
|
| 28 |
+
*multi-pass guarantee* if:
|
| 29 |
+
|
| 30 |
+
- `a == b` implies `++a == ++b` and
|
| 31 |
+
- The expression `((void)[](X x){++x;}(a), *a)` is equivalent to the
|
| 32 |
+
expression `*a`.
|
| 33 |
+
|
| 34 |
+
[*Note 2*: The requirement that `a == b` implies `++a == ++b` and the
|
| 35 |
+
removal of the restrictions on the number of assignments through a
|
| 36 |
+
mutable iterator (which applies to output iterators) allow the use of
|
| 37 |
+
multi-pass one-directional algorithms with forward
|
| 38 |
+
iterators. — *end note*]
|
| 39 |
+
|