2 <concept name=
"OutputIterator" category=
"Iterator"><!--
3 Based on concepts from the SGI Standard Template Library documentation:
4 Copyright (c) 1996-1999
5 Silicon Graphics Computer Systems, Inc.
8 Hewlett-Packard Company
10 Copyright 2000-2001 University of Notre Dame du Lac.
11 Copyright 2001-2002 Indiana University.
12 Some concepts based on versions from the MTL draft manual and Boost Graph
13 and Property Map documentation:
14 Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
16 <param name=
"Iter" role=
"iterator-type"/>
17 <param name=
"ValueType" role=
"value-type"/>
19 <use-header name=
"iterator"/>
21 <models-sentence>The iterator type
<arg num=
"1"/> (with value type
<arg num=
"2"/>) must be a model of
<self/>.
</models-sentence>
24 <para>An output iterator is an iterator that can write a sequence of
25 values. It is single-pass (old values of the iterator cannot be
26 re-used), and write-only.
</para>
28 <para>An output iterator represents a position in a (possibly infinite)
29 sequence. Therefore, the iterator can point into the sequence (returning
30 a value when dereferenced and being incrementable), or be off-the-end
31 (and not dereferenceable or incrementable).
</para>
34 <models const=
"no" testable=
"yes" concept=
"Assignable">
38 <models const=
"no" testable=
"yes" concept=
"Assignable">
39 <type name=
"ValueType"/>
42 <models const=
"no" testable=
"yes" concept=
"DefaultConstructible">
46 <models const=
"no" testable=
"yes" concept=
"EqualityComparable">
50 <associated-type name=
"value_type">
51 <get-member-type name=
"value_type">
52 <apply-template name=
"std::iterator_traits">
56 <description><simpara>The stated value type of the iterator (should be
57 <code>void
</code> for an output iterator that does not model some other
58 iterator concept).
</simpara></description>
61 <associated-type name=
"difference_type">
62 <get-member-type name=
"difference_type">
63 <apply-template name=
"std::iterator_traits">
67 <description><simpara>The difference type of the iterator
</simpara></description>
70 <associated-type name=
"category">
71 <get-member-type name=
"iterator_category">
72 <apply-template name=
"std::iterator_traits">
76 <description><simpara>The category of the iterator
</simpara></description>
79 <notation variables=
"i j">
85 <notation variables=
"x">
87 <type name=
"ValueType"/>
91 <valid-type-expression name=
"Category tag">
93 <type name=
"category"/>
95 <derived-from testable=
"yes">
96 <type name=
"std::output_iterator_tag"/>
98 <models-as-first-arg const=
"no" testable=
"yes" concept=
"DefaultConstructible"/>
99 <models-as-first-arg const=
"no" testable=
"yes" concept=
"CopyConstructible"/>
101 </valid-type-expression>
103 <valid-type-expression name=
"Difference type properties">
105 <type name=
"difference_type"/>
107 <models-as-first-arg const=
"no" testable=
"yes" concept=
"SignedInteger"/>
109 </valid-type-expression>
111 <valid-expression name=
"Dereference">
113 <sample-value><type name=
"Iter"/></sample-value>
116 <precondition><code>i
</code> is incrementable (not
117 off-the-end)
</precondition>
120 <valid-expression name=
"Dereference and assign">
123 <sample-value><type name=
"Iter"/></sample-value>
125 <sample-value><const><reference-to><type name=
"ValueType"/></reference-to></const></sample-value>
128 <precondition><code>i
</code> is incrementable (not
129 off-the-end)
</precondition>
130 <postcondition><code>*i
</code> may not be written to again until it has
131 been incremented.
</postcondition>
134 <valid-expression name=
"Preincrement">
136 <sample-value><reference-to><type name=
"Iter"/></reference-to></sample-value>
139 <require-same-type testable=
"yes">
140 <reference-to><type name=
"Iter"/></reference-to>
143 <precondition><code>i
</code> is incrementable (not
144 off-the-end)
</precondition>
147 <valid-expression name=
"Postincrement">
149 <sample-value><reference-to><type name=
"Iter"/></reference-to></sample-value>
152 <precondition><code>i
</code> is incrementable (not
153 off-the-end)
</precondition>
154 <semantics>Equivalent to
<code>(void)(++i)
</code></semantics>
155 <postcondition><code>i
</code> is dereferenceable or
156 off-the-end
</postcondition>
159 <valid-expression name=
"Postincrement, dereference, and assign">
163 <sample-value><reference-to><type name=
"Iter"/></reference-to></sample-value>
166 <sample-value><const><reference-to><type name=
"ValueType"/></reference-to></const></sample-value>
169 <precondition><code>i
</code> is incrementable (not
170 off-the-end)
</precondition>
171 <semantics>Equivalent to
<code>{*i = t; ++i;}
</code></semantics>
172 <postcondition><code>i
</code> is dereferenceable or
173 off-the-end
</postcondition>
177 All iterator operations must take amortized constant time.
181 <type name=
"std::ostream_iterator"/>
186 <type name=
"std::insert_iterator"/>
191 <type name=
"std::front_insert_iterator"/>
196 <type name=
"std::back_insert_iterator"/>
200 <see-also concept=
"InputIterator"/>
201 <see-also concept=
"ForwardIterator"/>