File: InputIterator.xml

package info (click to toggle)
boost1.74 1.74.0-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 464,084 kB
  • sloc: cpp: 3,338,324; xml: 131,293; python: 33,088; ansic: 14,336; asm: 4,034; sh: 3,351; makefile: 1,193; perl: 1,036; yacc: 478; php: 212; ruby: 102; lisp: 24; sql: 13; csh: 6
file content (179 lines) | stat: -rw-r--r-- 6,062 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?xml version="1.0"?>
<concept name="InputIterator" category="Iterator"><!--
Based on concepts from the SGI Standard Template Library documentation:
Copyright (c) 1996-1999
Silicon Graphics Computer Systems, Inc.

Copyright (c) 1994
Hewlett-Packard Company
--><!--
Copyright 2000-2001 University of Notre Dame du Lac.
Copyright 2001-2002 Indiana University.
Some concepts based on versions from the MTL draft manual and Boost Graph
and Property Map documentation:
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
-->
<!--
Permission to use, copy, modify, distribute and
sell this software and its documentation for any purpose is
hereby granted without fee, provided that the above copyright
notice appears in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation.  Silicon Graphics makes no representations
about the suitability of this software for any purpose.  It is
provided "as is" without express or implied
warranty.
-->
  <param name="Iter" role="iterator-type"/>

  <use-header name="iterator"/>

  <models-sentence>The iterator type <arg num="1"/> must be a model of <self/>.</models-sentence>

  <description>
  <para>An input iterator is an iterator that can read through a sequence of
  values.  It is single-pass (old values of the iterator cannot be
  re-used), and read-only.</para>

  <para>An input iterator represents a position in a sequence.  Therefore, the
  iterator can point into the sequence (returning a value when dereferenced
  and being incrementable), or be off-the-end (and not dereferenceable or
  incrementable).</para>
  </description>

  <refines const="no" concept="Assignable"/>
  <refines const="no" concept="DefaultConstructible"/>
  <refines const="no" concept="EqualityComparable"/>

  <notation variables="i j">
    <sample-value>
      <type name="Iter"/>
    </sample-value>
  </notation>

  <associated-type name="value_type">
    <get-member-type name="value_type">
      <apply-template name="std::iterator_traits">
	<type name="Iter"/>
      </apply-template>
    </get-member-type>
    <description><simpara>The value type of the iterator (not necessarily what
    <code>*i</code> returns)</simpara></description>
  </associated-type>

  <associated-type name="difference_type">
    <get-member-type name="difference_type">
      <apply-template name="std::iterator_traits">
	<type name="Iter"/>
      </apply-template>
    </get-member-type>
    <description><simpara>The difference type of the iterator</simpara></description>
  </associated-type>

  <associated-type name="category">
    <get-member-type name="iterator_category">
      <apply-template name="std::iterator_traits">
	<type name="Iter"/>
      </apply-template>
    </get-member-type>
    <description><simpara>The category of the iterator</simpara></description>
  </associated-type>

  <notation variables="x">
    <sample-value>
      <type name="value_type"/>
    </sample-value>
  </notation>

  <valid-type-expression name="Category tag">
    <description/>
    <type name="category"/>
    <return-type>
      <derived-from testable="yes">
	<type name="std::input_iterator_tag"/>
      </derived-from>
      <models-as-first-arg const="no" testable="yes" concept="DefaultConstructible"/>
      <models-as-first-arg const="no" testable="yes" concept="CopyConstructible"/>
    </return-type>
  </valid-type-expression>

  <valid-type-expression name="Value type copy constructibility">
    <description/>
    <type name="value_type"/>
    <return-type>
      <models-as-first-arg const="no" testable="yes" concept="CopyConstructible"/>
    </return-type>
  </valid-type-expression>

  <valid-type-expression name="Difference type properties">
    <description/>
    <type name="difference_type"/>
    <return-type>
      <models-as-first-arg const="no" testable="yes" concept="SignedInteger"/>
    </return-type>
  </valid-type-expression>

  <valid-expression name="Dereference">
    <dereference>
      <sample-value><type name="Iter"/></sample-value>
    </dereference>
    <return-type>
      <convertible-to testable="yes"><type name="value_type"/></convertible-to>
    </return-type>
    <precondition><code>i</code> is incrementable (not
    off-the-end)</precondition>
  </valid-expression>

  <valid-expression name="Preincrement">
    <preincrement>
      <sample-value><reference-to><type name="Iter"/></reference-to></sample-value>
    </preincrement>
    <return-type>
      <require-same-type testable="yes">
	<reference-to><type name="Iter"/></reference-to>
      </require-same-type>
    </return-type>
    <precondition><code>i</code> is incrementable (not
    off-the-end)</precondition>
  </valid-expression>

  <valid-expression name="Postincrement">
    <postincrement>
      <sample-value><reference-to><type name="Iter"/></reference-to></sample-value>
    </postincrement>
    <return-type/>
    <precondition><code>i</code> is incrementable (not
    off-the-end)</precondition>
    <semantics>Equivalent to <code>(void)(++i)</code></semantics>
    <postcondition><code>i</code> is dereferenceable or
    off-the-end</postcondition>
  </valid-expression>

  <valid-expression name="Postincrement and dereference">
    <dereference>
      <postincrement>
	<sample-value><reference-to><type name="Iter"/></reference-to></sample-value>
      </postincrement>
    </dereference>
    <return-type>
      <convertible-to testable="yes"><type name="value_type"/></convertible-to>
    </return-type>
    <precondition><code>i</code> is incrementable (not
    off-the-end)</precondition>
    <semantics>Equivalent to <code>{value_type t = *i; ++i; return t;}</code></semantics>
    <postcondition><code>i</code> is dereferenceable or
    off-the-end</postcondition>
  </valid-expression>

  <complexity>
  All iterator operations must take amortized constant time.
  </complexity>

  <example-model>
    <type name="std::istream_iterator"/>
  </example-model>

  <see-also concept="OutputIterator"/>
  <see-also concept="ForwardIterator"/>

</concept>