cplusplus.com cplusplus.com
cplusplus.com   C++ : Reference : Miscellaneous : iterator : OutputIterator
  Search:
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forums
Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
Miscellaneous
Miscellaneous
functional
iterator
memory
utility
iterator
advance
back_inserter
distance
front_inserter
inserter
iterator
iterator_traits
iterator categories:
· BidirectionalIterator
· ForwardIterator
· InputIterator
· OutputIterator
· RandomAccessIterator
predefined iterators:
· back_insert_iterator
· front_insert_iterator
· insert_iterator
· istreambuf_iterator
· istream_iterator
· ostreambuf_iterator
· ostream_iterator
· reverse_iterator

-

OutputIterator
<iterator>

Output iterator category

Output

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.

They have the following characteristics:

characteristicvalid expressions
Can be copied and copy-constructedX 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

InputIterator Input iterator category
ForwardIterator Forward iterator category
BidirectionalIterator Bidirectional iterator category
RandomAccessIterator Random-access iterator category
iterator Iterator definitions (header)

Home page | Privacy policy
© cplusplus.com, 2000-2008 - All rights reserved - v2.2
Spotted an error? contact us