3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Concept InputIterator</title>
5 <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="index.html" title="Concept reference">
8 <link rel="up" href="index.html" title="Concept reference">
9 <link rel="prev" href="Assignable.html" title="Concept Assignable">
10 <link rel="next" href="OutputIterator.html" title="Concept OutputIterator">
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
15 <td align="center"><a href="../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../more/index.htm">More</a></td>
22 <div class="spirit-nav">
23 <a accesskey="p" href="Assignable.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="index.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="OutputIterator.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
25 <div class="refentry">
26 <a name="InputIterator"></a><div class="titlepage"></div>
27 <div class="refnamediv">
28 <h2><span class="refentrytitle">Concept InputIterator</span></h2>
31 <div class="refsect1">
32 <a name="idp69168208"></a><h2>Description</h2>
33 <p>An input iterator is an iterator that can read through a sequence of
34 values. It is single-pass (old values of the iterator cannot be
35 re-used), and read-only.</p>
36 <p>An input iterator represents a position in a sequence. Therefore, the
37 iterator can point into the sequence (returning a value when dereferenced
38 and being incrementable), or be off-the-end (and not dereferenceable or
41 <div class="refsect1">
42 <a name="idp69169952"></a><h2>Refinement of</h2>
43 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
44 <li class="listitem"><p><a class="link" href="Assignable.html" title="Concept Assignable">Assignable</a></p></li>
45 <li class="listitem"><p><a class="link" href="DefaultConstructible.html" title="Concept DefaultConstructible">DefaultConstructible</a></p></li>
46 <li class="listitem"><p><a class="link" href="EqualityComparable.html" title="Concept EqualityComparable">EqualityComparable</a></p></li>
49 <div class="refsect1">
50 <a name="idp69173520"></a><h2>Associated types</h2>
51 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
53 <p><span class="bold"><strong>value_type</strong></span></p>
54 <pre class="literallayout">std::iterator_traits<Iter>::value_type</pre>
55 <p>The value type of the iterator (not necessarily what
56 <code class="computeroutput">*i</code> returns)</p>
59 <p><span class="bold"><strong>difference_type</strong></span></p>
60 <pre class="literallayout">std::iterator_traits<Iter>::difference_type</pre>
61 <p>The difference type of the iterator</p>
64 <p><span class="bold"><strong>category</strong></span></p>
65 <pre class="literallayout">std::iterator_traits<Iter>::iterator_category</pre>
66 <p>The category of the iterator</p>
70 <div class="refsect1">
71 <a name="idp69181056"></a><h2>Notation</h2>
72 <div class="variablelist"><dl class="variablelist">
73 <dt><span class="term">Iter</span></dt>
74 <dd>A type playing the role of iterator-type in the <a class="link" href="InputIterator.html" title="Concept InputIterator">InputIterator</a> concept.</dd>
76 <span class="term"><code class="varname">i</code>, </span><span class="term"><code class="varname">j</code></span>
78 <dd>Objects of type Iter</dd>
79 <dt><span class="term"><code class="varname">x</code></span></dt>
80 <dd>Object of type value_type</dd>
83 <div class="refsect1">
84 <a name="idp69185616"></a><h2>Type expressions</h2>
85 <div class="variablelist"><dl class="variablelist">
86 <dt><span class="term">Category tag</span></dt>
87 <dd><p><span class="type">category</span> must be
88 derived from <span class="type">std::input_iterator_tag</span>, a model of <a class="link" href="DefaultConstructible.html" title="Concept DefaultConstructible">DefaultConstructible</a>, and a model of <a class="link" href="CopyConstructible.html" title="Concept CopyConstructible">CopyConstructible</a>.
90 <dt><span class="term">Value type copy constructibility</span></dt>
91 <dd><p><span class="type">value_type</span> must be
92 a model of <a class="link" href="CopyConstructible.html" title="Concept CopyConstructible">CopyConstructible</a>.
94 <dt><span class="term">Difference type properties</span></dt>
95 <dd><p><span class="type">difference_type</span> must be
96 a model of <a class="link" href="SignedInteger.html" title="Concept SignedInteger">SignedInteger</a>.
100 <div class="refsect1">
101 <a name="idp74635392"></a><h2>Valid expressions</h2>
102 <div class="informaltable"><table class="table">
115 <th>Precondition</th>
117 <th>Postcondition</th>
121 <td><p>Dereference</p></td>
123 <td><p>Convertible to <span class="type">value_type</span></p></td>
124 <td><p><code class="computeroutput">i</code> is incrementable (not
125 off-the-end)</p></td>
130 <td><p>Preincrement</p></td>
132 <td><p><span class="type">Iter &</span></p></td>
133 <td><p><code class="computeroutput">i</code> is incrementable (not
134 off-the-end)</p></td>
139 <td><p>Postincrement</p></td>
142 <td><p><code class="computeroutput">i</code> is incrementable (not
143 off-the-end)</p></td>
144 <td><p>Equivalent to <code class="computeroutput">(void)(++i)</code></p></td>
145 <td><p><code class="computeroutput">i</code> is dereferenceable or
149 <td><p>Postincrement and dereference</p></td>
151 <td><p>Convertible to <span class="type">value_type</span></p></td>
152 <td><p><code class="computeroutput">i</code> is incrementable (not
153 off-the-end)</p></td>
154 <td><p>Equivalent to <code class="computeroutput">{value_type t = *i; ++i; return t;}</code></p></td>
155 <td><p><code class="computeroutput">i</code> is dereferenceable or
161 <div class="refsect1">
162 <a name="idp74651376"></a><h2>Complexity</h2>
164 All iterator operations must take amortized constant time.
167 <div class="refsect1">
168 <a name="idp74652016"></a><h2>Models</h2>
169 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><span class="simplelist"><span class="type">std::istream_iterator</span></span></li></ul></div>
171 <div class="refsect1">
172 <a name="idp74653408"></a><h2>See also</h2>
173 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
174 <li class="listitem"><p><a class="link" href="DefaultConstructible.html" title="Concept DefaultConstructible">DefaultConstructible</a></p></li>
175 <li class="listitem"><p><a class="link" href="EqualityComparable.html" title="Concept EqualityComparable">EqualityComparable</a></p></li>
176 <li class="listitem"><p><a class="link" href="ForwardIterator.html" title="Concept ForwardIterator">ForwardIterator</a></p></li>
177 <li class="listitem"><p><a class="link" href="OutputIterator.html" title="Concept OutputIterator">OutputIterator</a></p></li>
181 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
182 <td align="left"></td>
183 <td align="right"><div class="copyright-footer">Copyright © 2001, 2002 Indiana University<br>Copyright © 2000, 2001 University of Notre Dame du Lac<br>Copyright © 2000 Jeremy Siek, Lie-Quan Lee, Andrew Lumsdaine<br>Copyright © 1996-1999 Silicon Graphics Computer Systems, Inc.<br>Copyright © 1994 Hewlett-Packard Company<p>Distributed under the Boost Software License, Version 1.0.
184 (See accompanying file <code class="filename">LICENSE_1_0.txt</code> or copy at
185 <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
187 <p>This product includes software developed at the University
188 of Notre Dame and the Pervasive Technology Labs at Indiana
189 University. For technical information contact Andrew Lumsdaine
190 at the Pervasive Technology Labs at Indiana University. For
191 administrative and license questions contact the Advanced
192 Research and Technology Institute at 351 West 10th Street.
193 Indianapolis, Indiana 46202, phone 317-278-4100, fax
195 <p>Some concepts based on versions from the MTL draft manual
196 and Boost Graph and Property Map documentation, the SGI Standard
197 Template Library documentation and the Hewlett-Packard STL,
198 under the following license:
200 <div class="blockquote"><blockquote class="blockquote"><p>Permission to use, copy, modify, distribute and
201 sell this software and its documentation for any purpose is
202 hereby granted without fee, provided that the above copyright
203 notice appears in all copies and that both that copyright
204 notice and this permission notice appear in supporting
205 documentation. Silicon Graphics makes no representations
206 about the suitability of this software for any purpose. It is
207 provided "as is" without express or implied
208 warranty.</p></blockquote></div>
212 <div class="spirit-nav">
213 <a accesskey="p" href="Assignable.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="index.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="OutputIterator.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>