OutputIterator.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <?xml version="1.0"?>
  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.
  6. Copyright (c) 1994
  7. Hewlett-Packard Company
  8. --><!--
  9. Copyright 2000-2001 University of Notre Dame du Lac.
  10. Copyright 2001-2002 Indiana University.
  11. Some concepts based on versions from the MTL draft manual and Boost Graph
  12. and Property Map documentation:
  13. Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
  14. -->
  15. <param name="Iter" role="iterator-type"/>
  16. <param name="ValueType" role="value-type"/>
  17. <use-header name="iterator"/>
  18. <models-sentence>The iterator type <arg num="1"/> (with value type <arg num="2"/>) must be a model of <self/>.</models-sentence>
  19. <description>
  20. <para>An output iterator is an iterator that can write a sequence of
  21. values. It is single-pass (old values of the iterator cannot be
  22. re-used), and write-only.</para>
  23. <para>An output iterator represents a position in a (possibly infinite)
  24. sequence. Therefore, the iterator can point into the sequence (returning
  25. a value when dereferenced and being incrementable), or be off-the-end
  26. (and not dereferenceable or incrementable).</para>
  27. </description>
  28. <models const="no" testable="yes" concept="Assignable">
  29. <type name="Iter"/>
  30. </models>
  31. <models const="no" testable="yes" concept="Assignable">
  32. <type name="ValueType"/>
  33. </models>
  34. <models const="no" testable="yes" concept="DefaultConstructible">
  35. <type name="Iter"/>
  36. </models>
  37. <models const="no" testable="yes" concept="EqualityComparable">
  38. <type name="Iter"/>
  39. </models>
  40. <associated-type name="value_type">
  41. <get-member-type name="value_type">
  42. <apply-template name="std::iterator_traits">
  43. <type name="Iter"/>
  44. </apply-template>
  45. </get-member-type>
  46. <description><simpara>The stated value type of the iterator (should be
  47. <code>void</code> for an output iterator that does not model some other
  48. iterator concept).</simpara></description>
  49. </associated-type>
  50. <associated-type name="difference_type">
  51. <get-member-type name="difference_type">
  52. <apply-template name="std::iterator_traits">
  53. <type name="Iter"/>
  54. </apply-template>
  55. </get-member-type>
  56. <description><simpara>The difference type of the iterator</simpara></description>
  57. </associated-type>
  58. <associated-type name="category">
  59. <get-member-type name="iterator_category">
  60. <apply-template name="std::iterator_traits">
  61. <type name="Iter"/>
  62. </apply-template>
  63. </get-member-type>
  64. <description><simpara>The category of the iterator</simpara></description>
  65. </associated-type>
  66. <notation variables="i j">
  67. <sample-value>
  68. <type name="Iter"/>
  69. </sample-value>
  70. </notation>
  71. <notation variables="x">
  72. <sample-value>
  73. <type name="ValueType"/>
  74. </sample-value>
  75. </notation>
  76. <valid-type-expression name="Category tag">
  77. <description/>
  78. <type name="category"/>
  79. <return-type>
  80. <derived-from testable="yes">
  81. <type name="std::output_iterator_tag"/>
  82. </derived-from>
  83. <models-as-first-arg const="no" testable="yes" concept="DefaultConstructible"/>
  84. <models-as-first-arg const="no" testable="yes" concept="CopyConstructible"/>
  85. </return-type>
  86. </valid-type-expression>
  87. <valid-type-expression name="Difference type properties">
  88. <description/>
  89. <type name="difference_type"/>
  90. <return-type>
  91. <models-as-first-arg const="no" testable="yes" concept="SignedInteger"/>
  92. </return-type>
  93. </valid-type-expression>
  94. <valid-expression name="Dereference">
  95. <dereference>
  96. <sample-value><type name="Iter"/></sample-value>
  97. </dereference>
  98. <return-type/>
  99. <precondition><code>i</code> is incrementable (not
  100. off-the-end)</precondition>
  101. </valid-expression>
  102. <valid-expression name="Dereference and assign">
  103. <assign>
  104. <dereference>
  105. <sample-value><type name="Iter"/></sample-value>
  106. </dereference>
  107. <sample-value><const><reference-to><type name="ValueType"/></reference-to></const></sample-value>
  108. </assign>
  109. <return-type/>
  110. <precondition><code>i</code> is incrementable (not
  111. off-the-end)</precondition>
  112. <postcondition><code>*i</code> may not be written to again until it has
  113. been incremented.</postcondition>
  114. </valid-expression>
  115. <valid-expression name="Preincrement">
  116. <preincrement>
  117. <sample-value><reference-to><type name="Iter"/></reference-to></sample-value>
  118. </preincrement>
  119. <return-type>
  120. <require-same-type testable="yes">
  121. <reference-to><type name="Iter"/></reference-to>
  122. </require-same-type>
  123. </return-type>
  124. <precondition><code>i</code> is incrementable (not
  125. off-the-end)</precondition>
  126. </valid-expression>
  127. <valid-expression name="Postincrement">
  128. <postincrement>
  129. <sample-value><reference-to><type name="Iter"/></reference-to></sample-value>
  130. </postincrement>
  131. <return-type/>
  132. <precondition><code>i</code> is incrementable (not
  133. off-the-end)</precondition>
  134. <semantics>Equivalent to <code>(void)(++i)</code></semantics>
  135. <postcondition><code>i</code> is dereferenceable or
  136. off-the-end</postcondition>
  137. </valid-expression>
  138. <valid-expression name="Postincrement, dereference, and assign">
  139. <assign>
  140. <dereference>
  141. <postincrement>
  142. <sample-value><reference-to><type name="Iter"/></reference-to></sample-value>
  143. </postincrement>
  144. </dereference>
  145. <sample-value><const><reference-to><type name="ValueType"/></reference-to></const></sample-value>
  146. </assign>
  147. <return-type/>
  148. <precondition><code>i</code> is incrementable (not
  149. off-the-end)</precondition>
  150. <semantics>Equivalent to <code>{*i = t; ++i;}</code></semantics>
  151. <postcondition><code>i</code> is dereferenceable or
  152. off-the-end</postcondition>
  153. </valid-expression>
  154. <complexity>
  155. All iterator operations must take amortized constant time.
  156. </complexity>
  157. <example-model>
  158. <type name="std::ostream_iterator"/>
  159. <type name="..."/>
  160. </example-model>
  161. <example-model>
  162. <type name="std::insert_iterator"/>
  163. <type name="..."/>
  164. </example-model>
  165. <example-model>
  166. <type name="std::front_insert_iterator"/>
  167. <type name="..."/>
  168. </example-model>
  169. <example-model>
  170. <type name="std::back_insert_iterator"/>
  171. <type name="..."/>
  172. </example-model>
  173. <see-also concept="InputIterator"/>
  174. <see-also concept="ForwardIterator"/>
  175. </concept>