[iterator.concept.output]

# 24 Iterators library [[iterators]](./#iterators)

## 24.3 Iterator requirements [[iterator.requirements]](iterator.requirements#iterator.concept.output)

### 24.3.4 Iterator concepts [[iterator.concepts]](iterator.concepts#iterator.concept.output)

#### 24.3.4.10 Concept output_iterator [iterator.concept.output]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L1777)

The [output_iterator](#concept:output_iterator "24.3.4.10 Concept output_­iterator [iterator.concept.output]") concept defines requirements for a type that
can be used to write values (from the requirement for[indirectly_writable](iterator.concept.writable#concept:indirectly_writable "24.3.4.3 Concept indirectly_­writable [iterator.concept.writable]") ([[iterator.concept.writable]](iterator.concept.writable "24.3.4.3 Concept indirectly_­writable")))
and which can be both pre- and post-incremented[.](#1.sentence-1)

[*Note [1](#note-1)*:

Output iterators are not required to model [equality_comparable](concept.equalitycomparable#concept:equality_comparable "18.5.4 Concept equality_­comparable [concept.equalitycomparable]")[.](#1.sentence-2)

â *end note*]

template<class I, class T>concept [output_iterator](#concept:output_iterator "24.3.4.10 Concept output_­iterator [iterator.concept.output]") =[input_or_output_iterator](iterator.concept.iterator#concept:input_or_output_iterator "24.3.4.6 Concept input_­or_­output_­iterator [iterator.concept.iterator]")<I> &&[indirectly_writable](iterator.concept.writable#concept:indirectly_writable "24.3.4.3 Concept indirectly_­writable [iterator.concept.writable]")<I, T> &&requires(I i, T&& t) {*i++ = std::forward<T>(t); // not required to be equality-preserving};

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L1796)

Let E be an expression such that decltype((E)) is T, and let i be a
dereferenceable object of type I[.](#2.sentence-1)

I and T model [output_iterator](#concept:output_iterator "24.3.4.10 Concept output_­iterator [iterator.concept.output]")<I, T> only if*i++ = E; has effects equivalent to:*i = E;++i;

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L1805)

*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[.](#3.sentence-1)
