tmp/tmpfe5spw98/{from.md → to.md}
RENAMED
|
@@ -3,36 +3,38 @@
|
|
| 3 |
A class or pointer type `X` satisfies the requirements of a forward
|
| 4 |
iterator if
|
| 5 |
|
| 6 |
- `X` satisfies the requirements of an input iterator (
|
| 7 |
[[input.iterators]]),
|
| 8 |
-
- X satisfies the `DefaultConstructible` requirements (
|
| 9 |
[[utility.arg.requirements]]),
|
| 10 |
- if `X` is a mutable iterator, `reference` is a reference to `T`; if
|
| 11 |
-
`X` is a
|
| 12 |
- the expressions in Table [[tab:iterator.forward.requirements]] are
|
| 13 |
valid and have the indicated semantics, and
|
| 14 |
- objects of type `X` offer the multi-pass guarantee, described below.
|
| 15 |
|
| 16 |
-
The domain of == for forward iterators is that of iterators over the
|
| 17 |
same underlying sequence. However, value-initialized iterators may be
|
| 18 |
compared and shall compare equal to other value-initialized iterators of
|
| 19 |
-
the same type.
|
| 20 |
-
|
|
|
|
|
|
|
| 21 |
|
| 22 |
Two dereferenceable iterators `a` and `b` of type `X` offer the
|
| 23 |
*multi-pass guarantee* if:
|
| 24 |
|
| 25 |
- `a == b` implies `++a == ++b` and
|
| 26 |
- `X` is a pointer type or the expression `(void)++X(a), *a` is
|
| 27 |
equivalent to the expression `*a`.
|
| 28 |
|
| 29 |
-
The requirement that `a == b` implies `++a == ++b` (which is
|
| 30 |
-
for input and output iterators) and the removal of the
|
| 31 |
-
the number of the assignments through a mutable iterator
|
| 32 |
-
to output iterators) allows the use of multi-pass
|
| 33 |
-
algorithms with forward iterators.
|
| 34 |
|
| 35 |
If `a` and `b` are equal, then either `a` and `b` are both
|
| 36 |
dereferenceable or else neither is dereferenceable.
|
| 37 |
|
| 38 |
If `a` and `b` are both dereferenceable, then `a == b` if and only if
|
|
|
|
| 3 |
A class or pointer type `X` satisfies the requirements of a forward
|
| 4 |
iterator if
|
| 5 |
|
| 6 |
- `X` satisfies the requirements of an input iterator (
|
| 7 |
[[input.iterators]]),
|
| 8 |
+
- `X` satisfies the `DefaultConstructible` requirements (
|
| 9 |
[[utility.arg.requirements]]),
|
| 10 |
- if `X` is a mutable iterator, `reference` is a reference to `T`; if
|
| 11 |
+
`X` is a constant iterator, `reference` is a reference to `const T`,
|
| 12 |
- the expressions in Table [[tab:iterator.forward.requirements]] are
|
| 13 |
valid and have the indicated semantics, and
|
| 14 |
- objects of type `X` offer the multi-pass guarantee, described below.
|
| 15 |
|
| 16 |
+
The domain of `==` for forward iterators is that of iterators over the
|
| 17 |
same underlying sequence. However, value-initialized iterators may be
|
| 18 |
compared and shall compare equal to other value-initialized iterators of
|
| 19 |
+
the same type.
|
| 20 |
+
|
| 21 |
+
[*Note 1*: Value-initialized iterators behave as if they refer past the
|
| 22 |
+
end of the same empty sequence. — *end note*]
|
| 23 |
|
| 24 |
Two dereferenceable iterators `a` and `b` of type `X` offer the
|
| 25 |
*multi-pass guarantee* if:
|
| 26 |
|
| 27 |
- `a == b` implies `++a == ++b` and
|
| 28 |
- `X` is a pointer type or the expression `(void)++X(a), *a` is
|
| 29 |
equivalent to the expression `*a`.
|
| 30 |
|
| 31 |
+
[*Note 2*: The requirement that `a == b` implies `++a == ++b` (which is
|
| 32 |
+
not true for input and output iterators) and the removal of the
|
| 33 |
+
restrictions on the number of the assignments through a mutable iterator
|
| 34 |
+
(which applies to output iterators) allows the use of multi-pass
|
| 35 |
+
one-directional algorithms with forward iterators. — *end note*]
|
| 36 |
|
| 37 |
If `a` and `b` are equal, then either `a` and `b` are both
|
| 38 |
dereferenceable or else neither is dereferenceable.
|
| 39 |
|
| 40 |
If `a` and `b` are both dereferenceable, then `a == b` if and only if
|