std::Output Iterator
<iterator>
Output iterator category
Output iterators are iterators especially designed for sequential output operations, where each element pointed by the iterator is written a value only once and then the iterator is incremented.
There is not a single type of
output iterator: Each container defines its own specific iterator type able to iterate through it and access its elements. But all
output iterators support -at least- the following operations:
| characteristic | valid expressions |
| Can be copied and copy-constructed | X b(a);
b = a; |
Can be dereferenced (when not null)
and only to be the left side of an assignment operation.
Each value is dereferenced only once
(algorithms using OutputIterator are single pass algorithms) | *a = t |
| Can be incremented (when not null) | ++a
a++
*a++ = t |
Where
X is an iterator type,
a and
b are objects of this iterator type, and
t is an object of the type pointed by the iterator type.
See also
- Input Iterator
- Input iterator category
- Forward Iterator
- Forward iterator category
- Bidirectional Iterator
- Bidirectional iterator category
- Random Access Iterator
- Random-access iterator category
- iterator
- Iterator base class (class template
)