22
Iterators library
[iterators]
22.2
Iterator requirements
[iterator.requirements]
22.2.2
Cpp17Iterator
[iterator.iterators]
1
#
The
Cpp17Iterator
requirements form the basis of the iterator taxonomy; every iterator satisfies the
Cpp17Iterator
requirements
.
This set of requirements specifies operations for dereferencing and incrementing an iterator
.
Most algorithms will require additional operations to
read
or
write
values, or to provide a richer set of iterator movements (
[forward.iterators]
,
[bidirectional.iterators]
,
[random.access.iterators]
)
.
2
#
A type
X
satisfies the
Cpp17Iterator
requirements if:
(2.1)
X
satisfies the
Cpp17CopyConstructible
,
Cpp17CopyAssignable
, and
Cpp17Destructible
requirements (
[utility.arg.requirements]
) and lvalues of type
X
are swappable (
[swappable.requirements]
), and
(2.2)
the expressions in Table
75
are valid and have the indicated semantics
.
Table
75
—
Cpp17Iterator
requirements
Expression
Return type
Operational
Assertion/note
semantics
pre-/post-condition
*r
unspecified
Requires:
r
is dereferenceable
.
++r
X&