[output.iterators]
24 Iterators library [iterators]
24.3 Iterator requirements [iterator.requirements]
24.3.5 C++17 iterator requirements [iterator.cpp17]
24.3.5.4 Output iterators [output.iterators]
A class or pointer type X meets the requirements of an output iterator if X meets the Cpp17Iterator requirements ([iterator.iterators]) and the expressions in Table 80 are valid and have the indicated semantics.
Table 80 — Cpp17OutputIterator requirements (in addition to Cpp17Iterator) [tab:outputiterator]
Expression | Return type | Operational | Assertion/note |
semantics | pre-/post-condition | ||
*r = o | result is not used | ||
++r | X& | ||
r++ | convertible to const X& | { X tmp = r; | |
*r++ = o | result is not used |
Recommended practice: The implementation of an algorithm on output iterators should never attempt to pass through the same iterator twice; such an algorithm should be a single-pass algorithm.