[iterator.iterators] (original) (raw)
23 Iterators library [iterators]
23.3 Iterator requirements [iterator.requirements]
23.3.5 C++17 iterator requirements [iterator.cpp17]
23.3.5.2 Cpp17Iterator [iterator.iterators]
The Cpp17Iterator requirements form the basis of the iterator taxonomy; every iterator meets the Cpp17Iterator requirements.
This set of requirements specifies operations for dereferencing and incrementing an iterator.
A type X meets the Cpp17Iterator requirements if:
- X meets the Cpp17CopyConstructible, Cpp17CopyAssignable, and_Cpp17Destructible_ requirements ([utility.arg.requirements]) and lvalues of type X are swappable ([swappable.requirements]), and
- iterator_traits<X>::difference_type is a signed integer type or void, and
- the expressions in Table 84 are valid and have the indicated semantics.
Table 84: Cpp17Iterator requirements [tab:iterator]
| 🔗 | Expression | Return type | Operational | Assertion/note |
|---|---|---|---|---|
| 🔗 | semantics | pre-/post-condition | ||
| 🔗 | *r | unspecified | Preconditions: r is dereferenceable. | |
| 🔗 | ++r | X& |