##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# C++ concepts: OutputIterator

From cppreference.com
< cpp‎ | concept

An `OutputIterator` is an `Iterator` that can write to the pointed-to element.

An example of a type that implements `OutputIterator` is std::ostream_iterator.

When `ForwardIterator`, `BidirectionalIterator`, or `RandomAccessIterator` satisfies the `OutputIterator` requirements in addition to its own requirements, it is described as mutable.

### [edit] Requirements

- `Iterator`

In addition to the above requirement, for a type `It` to be an `OutputIterator`, instances `i` and `o` of `It` must:

Expression | Return | Equivalent expression | Notes
--- | --- | --- | ---
*i = o |  |  | it may not be possible to write twice in the same iterator
++i | It& |  | After this, copies of `i` may be invalidated. Post: &r == &++r
i++ | const It& | It temp = i; ++i; return temp; |
*i++ = o |  | *i = o; ++i; |

### [edit] See also

- Iterator library

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/concept/OutputIterator&oldid=45713"