2 <concept name=
"InputIterator" 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"/>
18 <use-header name=
"iterator"/>
20 <models-sentence>The iterator type
<arg num=
"1"/> must be a model of
<self/>.
</models-sentence>
23 <para>An input iterator is an iterator that can read through a sequence of
24 values. It is single-pass (old values of the iterator cannot be
25 re-used), and read-only.
</para>
27 <para>An input iterator represents a position in a sequence. Therefore, the
28 iterator can point into the sequence (returning a value when dereferenced
29 and being incrementable), or be off-the-end (and not dereferenceable or
30 incrementable).
</para>
33 <refines const=
"no" concept=
"Assignable"/>
34 <refines const=
"no" concept=
"DefaultConstructible"/>
35 <refines const=
"no" concept=
"EqualityComparable"/>
37 <notation variables=
"i j">
43 <associated-type name=
"value_type">
44 <get-member-type name=
"value_type">
45 <apply-template name=
"std::iterator_traits">
49 <description><simpara>The value type of the iterator (not necessarily what
50 <code>*i
</code> returns)
</simpara></description>
53 <associated-type name=
"difference_type">
54 <get-member-type name=
"difference_type">
55 <apply-template name=
"std::iterator_traits">
59 <description><simpara>The difference type of the iterator
</simpara></description>
62 <associated-type name=
"category">
63 <get-member-type name=
"iterator_category">
64 <apply-template name=
"std::iterator_traits">
68 <description><simpara>The category of the iterator
</simpara></description>
71 <notation variables=
"x">
73 <type name=
"value_type"/>
77 <valid-type-expression name=
"Category tag">
79 <type name=
"category"/>
81 <derived-from testable=
"yes">
82 <type name=
"std::input_iterator_tag"/>
84 <models-as-first-arg const=
"no" testable=
"yes" concept=
"DefaultConstructible"/>
85 <models-as-first-arg const=
"no" testable=
"yes" concept=
"CopyConstructible"/>
87 </valid-type-expression>
89 <valid-type-expression name=
"Value type copy constructibility">
91 <type name=
"value_type"/>
93 <models-as-first-arg const=
"no" testable=
"yes" concept=
"CopyConstructible"/>
95 </valid-type-expression>
97 <valid-type-expression name=
"Difference type properties">
99 <type name=
"difference_type"/>
101 <models-as-first-arg const=
"no" testable=
"yes" concept=
"SignedInteger"/>
103 </valid-type-expression>
105 <valid-expression name=
"Dereference">
107 <sample-value><type name=
"Iter"/></sample-value>
110 <convertible-to testable=
"yes"><type name=
"value_type"/></convertible-to>
112 <precondition><code>i
</code> is incrementable (not
113 off-the-end)
</precondition>
116 <valid-expression name=
"Preincrement">
118 <sample-value><reference-to><type name=
"Iter"/></reference-to></sample-value>
121 <require-same-type testable=
"yes">
122 <reference-to><type name=
"Iter"/></reference-to>
125 <precondition><code>i
</code> is incrementable (not
126 off-the-end)
</precondition>
129 <valid-expression name=
"Postincrement">
131 <sample-value><reference-to><type name=
"Iter"/></reference-to></sample-value>
134 <precondition><code>i
</code> is incrementable (not
135 off-the-end)
</precondition>
136 <semantics>Equivalent to
<code>(void)(++i)
</code></semantics>
137 <postcondition><code>i
</code> is dereferenceable or
138 off-the-end
</postcondition>
141 <valid-expression name=
"Postincrement and dereference">
144 <sample-value><reference-to><type name=
"Iter"/></reference-to></sample-value>
148 <convertible-to testable=
"yes"><type name=
"value_type"/></convertible-to>
150 <precondition><code>i
</code> is incrementable (not
151 off-the-end)
</precondition>
152 <semantics>Equivalent to
<code>{value_type t = *i; ++i; return t;}
</code></semantics>
153 <postcondition><code>i
</code> is dereferenceable or
154 off-the-end
</postcondition>
158 All iterator operations must take amortized constant time.
162 <type name=
"std::istream_iterator"/>
165 <see-also concept=
"OutputIterator"/>
166 <see-also concept=
"ForwardIterator"/>