updated to match working group paper

[SVN r10294]
This commit is contained in:
Jeremy Siek
2001-06-08 15:36:30 +00:00
parent 799158841e
commit efecfd17b9
3 changed files with 369 additions and 312 deletions

View File

@ -7,20 +7,16 @@ Letter
Single Single
-2 -2
1200 2 1200 2
6 825 1575 3825 4500 6 750 2100 3750 4125
2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 1 0 2 2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00 1 1 1.00 60.00 120.00
1725 2400 1725 1800 1650 3825 1650 3225
2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 1 0 2 2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00 1 1 1.00 60.00 120.00
1725 4200 1725 3600 1650 2925 1650 2325
2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 1 0 2 4 0 0 100 0 19 18 0.0000 4 210 1995 750 2325 ForwardIterator\001
1 1 1.00 60.00 120.00 4 0 0 100 0 19 18 0.0000 4 210 2580 750 3225 BidirectionalIterator\001
1725 3300 1725 2700 4 0 0 100 0 19 18 0.0000 4 210 2940 750 4125 RandomAccessIterator\001
4 0 0 100 0 19 18 0.0000 4 255 2370 825 1800 SinglePassIterator\001
4 0 0 100 0 19 18 0.0000 4 195 1995 825 2700 ForwardIterator\001
4 0 0 100 0 19 18 0.0000 4 195 2565 825 3600 BidirectionalIterator\001
4 0 0 100 0 19 18 0.0000 4 195 2955 825 4500 RandomAccessIterator\001
-6 -6
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00 1 1 1.00 60.00 120.00
@ -31,7 +27,11 @@ Single
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00 1 1 1.00 60.00 120.00
6900 3000 7500 2400 6900 3000 7500 2400
4 0 0 100 0 19 18 0.0000 4 195 1995 6600 2400 WritableIterator\001 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
4 0 0 100 0 19 18 0.0000 4 195 2130 3900 2400 ReadableIterator\001 1 1 1.00 60.00 120.00
4 0 0 50 0 19 18 0.0000 4 195 2805 5700 3300 MutableLvalueIterator\001 6900 3000 9075 2475
4 0 0 50 0 19 18 0.0000 4 195 2955 3900 3900 ConstantLvalueIterator\001 4 0 0 100 0 19 18 0.0000 4 210 2040 6600 2400 WritableIterator\001
4 0 0 100 0 19 18 0.0000 4 210 2145 3900 2400 ReadableIterator\001
4 0 0 50 0 19 18 0.0000 4 210 2835 5700 3300 MutableLvalueIterator\001
4 0 0 50 0 19 18 0.0000 4 210 2970 3900 3900 ConstantLvalueIterator\001
4 0 0 50 0 19 18 0.0000 4 270 2355 9075 2400 SwappableIterator\001

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -43,53 +43,68 @@
<BR Clear> <BR Clear>
<h1>Iterator Concepts</h1> <h1>Iterator Concepts</h1>
<p>The standard iterator concepts (the iterator requirements defined <p>The standard iterator categories and requirements are flawed because
in the C++ Standard) have a flaw. They glom together two separate they use a single hierarchy of requirements to address two orthogonal
issues into a single set of concepts. The two issues are iterator issues: <b><i>iterator traversal</i></b> and <b><i>dereference return
traversal and dereference return type semantics. These two issues are type</i></b>. The current iterator requirement hierarchy is mainly
inherently orthogonal and therefore ought to be represented by two geared towards iterator traversal (hence the category names), while
separate sets of concepts. The concepts described here do just requirements that address dereference return type sneak in at various
that.</p> places.
<p>
The iterator requirements should be separated into two hierarchies.
One set of concepts handles the return type semantics: One set of concepts handles the return type semantics:
<ul> <ul>
<li><a href="#concept:ReadableIterator">Readable Iterator</a></li> <li><a href="#concept:ReadableIterator">Readable Iterator</a></li>
<li><a href="#concept:WritableIterator">Writable Iterator</a></li> <li><a href="#concept:WritableIterator">Writable Iterator</a></li>
<li><a href="#concept:MutableLvalueIterator">Mutable Lvalue Iterator</a></li> <li><a href="#concept:SwappableIterator">Swappable Iterator</a></li>
<li><a href="#concept:ConstantLvalueIterator">Constant Lvalue Iterator</a></li> <li><a href="#concept:ConstantLvalueIterator">Constant Lvalue Iterator</a></li>
<li><a href="#concept:MutableLvalueIterator">Mutable Lvalue Iterator</a></li>
</ul> </ul>
The other set of concepts handles iterator traversal: The other set of concepts handles iterator traversal:
<ul> <ul>
<li><a href="#concept:SinglePassIterator">Single-Pass Iterator</a></li> <li><a href="#concept:ForwardTraversalIterator">Forward Traversal Iterator</a></li>
<li><a href="#concept:ForwardIterator">Forward Iterator</a></li> <li><a href="#concept:BidirectionalTraversalIterator">Bidirectional Traversal Iterator</a></li>
<li><a href="#concept:BidirectionalIterator">Bidirectional Iterator</a></li> <li><a href="#concept:RandomAccessTraversalIterator">Random Access Traversal Iterator</a></li>
<li><a href="#concept:RandomAccessIterator">Random Access Iterator</a></li>
</ul> </ul>
The current Input Iterator and Output Iterator requirements will
continue to be used as is. Note that Input Iterator implies Readable
Iterator and Output Iterator implies Writable Iterator.
<p>
Note: we considered defining a Single-Pass Iterator, which could be
combined with Readable or Writable Iterator to replace the Input and
Output Iterator requirements. We rejected this idea because there are
some differences between Input and Output Iterators that make it hard
to merge them: for example Input Iterator requires Equality Comparable
while Output Iterator does not.
<p></p> <p></p>
<DIV ALIGN="CENTER"><A NAME="fig:graph-concepts"></A></A> <DIV ALIGN="CENTER"><A NAME="fig:graph-concepts"></A></A>
<TABLE> <TABLE>
<CAPTION ALIGN="TOP"><STRONG>Figure 1:</STRONG> <CAPTION ALIGN="TOP"><STRONG>Figure 1:</STRONG>
The iterator concepts and refinement relationships. The iterator concepts and refinement relationships.
</CAPTION> </CAPTION>
<TR><TD><IMG SRC="./iterator_concepts.gif" width="541" height="214"></TD></TR> <TR><TD><IMG SRC="./iterator_concepts.gif" ></TD></TR>
</TABLE> </TABLE>
</DIV> </DIV>
<p></p> <p></p>
<h2>Relationship with the standard iterator concepts</h2> <h2>Relationship with the standard iterator concepts</h2>
<p> <p>
std::Input Iterator refines boost::Single-Pass Iterator and std::Input Iterator implies boost::ReadableIterator.
boost::ReadableIterator.
<p> <p>
std::Output Iterator refines boost::Single-Pass Iterator and std::Output Iterator implies boost::Writable Iterator.
boost::Writable Iterator.
<p> <p>
std::Forward Iterator refines boost::Forward Iterator and std::Forward Iterator refines boost::Forward Iterator and
@ -106,106 +121,99 @@ boost::Constant Lvalue Iterator or boost::Mutable Lvalue Iterator.
<h3>Notation</h3> <h3>Notation</h3>
<Table> <Table>
<TR> <tr>
<TD><tt>X</tt></TD> <td><tt>X</tt></td>
<TD>The iterator type.</TD> <td>The iterator type.</td>
</TR> </tr>
<TR> <tr>
<TD><tt>T</tt></TD> <td><tt>T</tt></td>
<TD>The value type of <tt>X</tt>.</TD> <td>The value type of <tt>X</tt>, i.e., <tt>std::iterator_traits&lt;X&gt;::value_type</tt>.</td>
</TR> </tr>
<TR> <tr>
<TD><tt>x</tt>, <tt>y</tt></TD> <td><tt>x</tt>, <tt>y</tt></td>
<TD>An object of type <tt>X</tt>.</TD> <td>An object of type <tt>X</tt>.</td>
</TR> </tr>
<TR> <tr>
<TD><tt>t</tt></TD> <td><tt>t</tt></td>
<TD>An object of type <tt>T</tt>.</TD> <td>An object of type <tt>T</tt>.</td>
</tr> </tr>
</table> </table>
<p> <p>
<hr> <hr>
<!--------------------------------------------------------------------------->
<H2><A NAME="concept:ReadableIterator"></A> <H3><A NAME="concept:ReadableIterator"></A>
Readable Iterator Readable Iterator
</H2> </H3>
A Readable Iterator is an iterator that dereferences to produce an A Readable Iterator is an iterator that dereferences to produce an
rvalue that is convertible to the <tt>value_type</tt> of the rvalue that is convertible to the <tt>value_type</tt> of the
iterator. For example, derefencing may return a temporary object and iterator.
therefore it would be a mistake to bind the result to a reference.
Also, an attempt to assign a value to the result will most likely
cause an error.
<pre>
template &lt;class Readable Iterator&gt;
void foo(Readable Iterator x)
{
typedef std::iterator_traits&lt;Readable Iterator&gt;::value_type T;
T t = *x; // Read a value. This is OK.
T& s = *x; // Bind to a reference. This is a bad idea.
*x = t; // Try to assign. This is a really bad idea.
}
</pre>
<h3>Associated Types</h3> <h3>Associated Types</h3>
<Table border> <Table border>
<TR> <tr>
<TD>Value type</TD> <td>Value type</td>
<TD><tt><a href="./iterator_traits.htm">boost::iterator_traits</a>&lt;X&gt;::value_type</tt></TD> <td><tt>std::iterator_traits&lt;X&gt;::value_type</tt></td>
<TD> <td>The type of the objects pointed to by the iterator.</td>
The type of the value obtained by dereferencing a LvalueIterator
</TD>
</tr> </tr>
<TR> <tr>
<TD>Return Category</TD> <td>Reference type</td>
<TD><tt><a href="./iterator_traits.htm">boost::iterator_traits</a>&lt;X&gt;::return_category</tt></TD> <td><tt>std::iterator_traits&lt;X&gt;::reference</tt></td>
<TD> <td>
A type convertible to <tt>boost::readable_iterator_tag</tt> The return type of dereferencing the iterator. This
</TD> type must be convertible to <tt>T</tt>.
</td>
</tr>
<tr>
<td>Return Category</td>
<td><tt>std::return_category&lt;X&gt;::type</tt></td>
<td>
A type convertible to <tt>std::readable_iterator_tag</tt>
</td>
</tr> </tr>
</Table> </Table>
<h3>Refinement of</h3> <h3>Refinement of</h3>
<A href="http://www.sgi.com/Technology/STL/Assignable.html">Assignable</A>, <A href="http://www.boost.org/libs/utility/CopyConstructible.html">Copy Constructible</A>
<A href="http://www.sgi.com/Technology/STL/EqualityComparable.html">Equality Comparable</A>,
<A href="http://www.sgi.com/Technology/STL/DefaultConstructible.html">Default Constructible</A>
<h3>Valid expressions</h3> <h3>Valid expressions</h3>
<Table border> <Table border>
<TR><TH>Name</TH><TH>Expression</TH><TH>Type requirements</TH><TH>Return type</TH></TR> <tr><TH>Name</TH><TH>Expression</TH><TH>Type requirements</TH><TH>Return type</TH></tr>
<TR> <tr>
<TD>Dereference</TD> <td>Dereference</td>
<TD><tt>*x</tt></TD> <td><tt>*x</tt></td>
<TD>&nbsp;</TD> <td>&nbsp;</td>
<TD>Convertible to <tt>T</tt>.</TD> <td><tt>std::iterator_traits&lt;X&gt;::reference</tt></td>
</TR> </tr>
<TR> <tr>
<TD>Member access</TD> <td>Member access</td>
<TD><tt>x-&gt;m</tt></TD> <td><tt>x-&gt;m</tt></td>
<TD><tt>T</tt> is a type with a member named <tt>m</tt>.</TD> <td><tt>T</tt> is a type with a member named <tt>m</tt>.</td>
<TD> <td>
&nbsp; If <tt>m</tt> is a data member, the type of <tt>m</tt>.
</TD> If <tt>m</tt> is a member function, the return type of <tt>m</tt>.
</td>
</tr> </tr>
</table> </table>
<p> <p>
<hr> <hr>
<!--------------------------------------------------------------------------->
<H2><A NAME="concept:WritableIterator"></A> <H3><A NAME="concept:WritableIterator"></A>
Writable Iterator Writable Iterator
</H2> </H3>
A Writable Iterator is an iterator that can be used to store a value A Writable Iterator is an iterator that can be used to store a value
using the dereference-assignment expression. using the dereference-assignment expression.
@ -226,12 +234,12 @@ conversions on <tt>a</tt>.
<Table border> <Table border>
<TR> <tr>
<TD>Return Category</TD> <td>Return Category</td>
<TD><tt><a href="./iterator_traits.htm">boost::iterator_traits</a>&lt;X&gt;::return_category</tt></TD> <td><tt>std::return_category&lt;X&gt;::type</tt></td>
<TD> <td>
A type convertible to <tt>boost::writable_iterator_tag</tt> A type convertible to <tt>std::writable_iterator_tag</tt>
</TD> </td>
</tr> </tr>
</Table> </Table>
@ -240,30 +248,100 @@ conversions on <tt>a</tt>.
<h3>Refinement of</h3> <h3>Refinement of</h3>
<A href="http://www.sgi.com/Technology/STL/Assignable.html">Assignable</A>, <A href="http://www.boost.org/libs/utility/CopyConstructible.html">Copy Constructible</A>
<A href="http://www.sgi.com/Technology/STL/EqualityComparable.html">Equality Comparable</A>,
<A href="http://www.sgi.com/Technology/STL/DefaultConstructible.html">Default Constructible</A>
<h3>Valid expressions</h3> <h3>Valid expressions</h3>
<Table border> <Table border>
<TR> <tr>
<TH>Name</TH><TH>Expression</TH><TH>Return type</TH> <TH>Name</TH><TH>Expression</TH><TH>Return type</TH>
</TR> </tr>
<TR> <tr>
<TD>Dereference assignment</TD> <td>Dereference assignment</td>
<TD><tt>*x = a</tt></TD> <td><tt>*x = a</tt></td>
<TD>unspecified</TD> <td>unspecified</td>
</TR> </tr>
</table> </table>
<p> <p>
<hr>
<H2><A NAME="concept:ConstantLvalueIterator"></A> <hr>
<!--------------------------------------------------------------------------->
<H3><A NAME="concept:SwappableIterator"></A>
Swappable Iterator
</H3>
A Swappable Iterator is an iterator whose dereferenced values can be
swapped.
<p>
Note: the requirements for Swappable Iterator are dependent on the
issues surrounding <tt>std::swap()</tt> being resolved. Here we assume
that the issue will be resolved by allowing the overload of
<tt>std::swap()</tt> for user-defined types.
<p>
Note: Readable Iterator and Writable Iterator combined implies
Swappable Iterator because of the fully templated
<tt>std::swap()</tt>. However, Swappable Iterator does not imply
Readable Iterator nor Writable Iterator.
<h3>Associated Types</h3>
<Table border>
<tr>
<td>Return Category</td>
<td><tt>std::return_category&lt;X&gt;::type</tt></td>
<td>
A type convertible to <tt>std::swappable_iterator_tag</tt>
</td>
</tr>
</Table>
<h3>Valid expressions</h3>
Of the two valid expressions listed below, only one <b>OR</b> the
other is required. If <tt>std::iter_swap()</tt> is overloaded for
<tt>X</tt> then <tt>std::swap()</tt> is not required. If
<tt>std::iter_swap()</tt> is not overloaded for <tt>X</tt> then the
default (fully templated) version is used, which will call
<tt>std::swap()</tt> (this means changing the current requirements for
<tt>std::iter_swap()</tt>).
<p>
<Table border>
<tr>
<TH>Name</TH><TH>Expression</TH><TH>Return type</TH>
</tr>
<tr>
<td>Iterator Swap</td>
<td><tt>std::iter_swap(x, y)</tt></td>
<td>void</td>
</tr>
<tr>
<td>Dereference and Swap</td>
<td><tt>std::swap(*x, *y)</tt></td>
<td>void</td>
</tr>
</table>
<p>
<hr>
<!--------------------------------------------------------------------------->
<H3><A NAME="concept:ConstantLvalueIterator"></A>
Constant Lvalue Iterator Constant Lvalue Iterator
</H2> </H3>
A Constant Lvalue Iterator is an iterator that dereferences to produce a A Constant Lvalue Iterator is an iterator that dereferences to produce a
const reference to the pointed-to object, i.e., the associated const reference to the pointed-to object, i.e., the associated
@ -275,72 +353,72 @@ iterator.
<h3>Refinement of</h3> <h3>Refinement of</h3>
<a href="#concept:Readable Iterator">Readable Iterator</a> <a href="#concept:ReadableIterator">Readable Iterator</a>
<h3>Associated Types</h3> <h3>Associated Types</h3>
<Table border> <Table border>
<TR> <tr>
<TD>Value type</TD> <td>Reference type</td>
<TD><tt><a href="./iterator_traits.htm">boost::iterator_traits</a>&lt;X&gt;::value_type</tt></TD> <td><tt>std::iterator_traits&lt;X&gt;::reference</tt></td>
<TD> <td>
The type of the value obtained by dereferencing a Constant Lvalue Iterator. The return type of dereferencing the iterator, which must be
</TD>
</tr>
<TR>
<TD>Reference type</TD>
<TD><tt><a href="./iterator_traits.htm">boost::iterator_traits</a>&lt;X&gt;::reference</tt></TD>
<TD>
The return type of <tt>operator*()</tt>, which must be
<tt>const T&amp;</tt>. <tt>const T&amp;</tt>.
</TD> </td>
</tr> </tr>
<TR> <!-- I don't think this is needed
<TD>POinter type</TD> <tr>
<TD><tt><a href="./iterator_traits.htm">boost::iterator_traits</a>&lt;X&gt;::pointer</tt></TD> <td>Pointer type</td>
<TD> <td><tt>std::iterator_traits&lt;X&gt;::pointer</tt></td>
<td>
The pointer to the value type, which must be <tt>const T*</tt>. The pointer to the value type, which must be <tt>const T*</tt>.
</TD> </td>
</tr> </tr>
-->
<TR> <tr>
<TD>Return Category</TD> <td>Return Category</td>
<TD><tt><a href="./iterator_traits.htm">boost::iterator_traits</a>&lt;X&gt;::return_category</tt></TD> <td><tt>std::return_category&lt;X&gt;::type</tt></td>
<TD> <td>
A type convertible to <tt>boost::constant_lvalue_iterator_tag</tt> A type convertible to <tt>std::constant_lvalue_iterator_tag</tt>
</TD> </td>
</tr> </tr>
</table> </table>
<!-- these are not necessary now that we use reference as operator* return type
<h3>Valid expressions</h3> <h3>Valid expressions</h3>
<Table border> <Table border>
<TR><TH>Name</TH><TH>Expression</TH><TH>Type requirements</TH><TH>Return type</TH></TR> <tr><TH>Name</TH><TH>Expression</TH><TH>Type requirements</TH><TH>Return type</TH></tr>
<TR> <tr>
<TD>Dereference</TD> <td>Dereference</td>
<TD><tt>*x</tt></TD> <td><tt>*x</tt></td>
<TD>&nbsp;</TD> <td>&nbsp;</td>
<TD><tt>const T&amp;</tt></TD> <td><tt>std::iterator_traits&lt;X&gt;::reference</tt></td>
</TR> </tr>
<TR> <tr>
<TD>Member access</TD> <td>Member access</td>
<TD><tt>x-&gt;m</tt></TD> <td><tt>x-&gt;m</tt></td>
<TD><tt>T</tt> is a type with a member named <tt>m</tt>.</TD> <td><tt>T</tt> is a type with a member named <tt>m</tt>.</td>
<TD> <td>
&nbsp; &nbsp;
</TD> </td>
</tr> </tr>
</table> </table>
-->
<H2><A NAME="concept:MutableLvalueIterator"></A> <p>
<hr>
<!--------------------------------------------------------------------------->
<H3><A NAME="concept:MutableLvalueIterator"></A>
Mutable Lvalue Iterator Mutable Lvalue Iterator
</H2> </H3>
A Mutable Lvalue Iterator is an iterator that dereferences to produce a A Mutable Lvalue Iterator is an iterator that dereferences to produce a
reference to the pointed-to object. The associated <tt>reference</tt> reference to the pointed-to object. The associated <tt>reference</tt>
@ -350,8 +428,9 @@ pointers and references previously obtained from that iterator.
<h3>Refinement of</h3> <h3>Refinement of</h3>
<a href="#concept:Readable Iterator">Readable Iterator</a> and <a href="#concept:ReadableIterator">Readable Iterator</a>,
<a href="#concept:WritableIterator">Writable Iterator</a>. <a href="#concept:WritableIterator">Writable Iterator</a>,
and <a href="#concept:SwappableIterator">Swappable Iterator</a>.
@ -359,241 +438,219 @@ pointers and references previously obtained from that iterator.
<Table border> <Table border>
<TR> <tr>
<TD>Value type</TD> <td>Reference type</td>
<TD><tt><a href="./iterator_traits.htm">boost::iterator_traits</a>&lt;X&gt;::value_type</tt></TD> <td><tt>std::iterator_traits&lt;X&gt;::reference</tt></td>
<TD> <td>The return type of dereferencing the iterator, which must be
The type of the value obtained by dereferencing a Mutable Lvalue Iterator. <tt>T&amp;</tt>.</td>
</TD>
</tr> </tr>
<TR> <!-- I don't think this is necessary
<TD>Reference type</TD> <tr>
<TD><tt><a href="./iterator_traits.htm">boost::iterator_traits</a>&lt;X&gt;::reference</tt></TD> <td>Pointer type</td>
<TD> <td><tt>std::iterator_traits&lt;X&gt;::pointer</tt></td>
The return type of <tt>operator*()</tt>, which is <td>
<tt>T&amp;</tt>.
</TD>
</tr>
<TR>
<TD>Pointer type</TD>
<TD><tt><a href="./iterator_traits.htm">boost::iterator_traits</a>&lt;X&gt;::pointer</tt></TD>
<TD>
The pointer to the value type, which is <tt>T*</tt>. The pointer to the value type, which is <tt>T*</tt>.
</TD> </td>
</tr> </tr>
-->
<TR> <tr>
<TD>Return Category</TD> <td>Return Category</td>
<TD><tt><a href="./iterator_traits.htm">boost::iterator_traits</a>&lt;X&gt;::return_category</tt></TD> <td><tt>std::return_category&lt;X&gt;::type</tt></td>
<TD> <td>
A type convertible to <tt>boost::mutable_lvalue_iterator_tag</tt> A type convertible to <tt>std::mutable_lvalue_iterator_tag</tt>
</TD> </td>
</tr> </tr>
</table> </table>
<!-- no longer needed since the return type is specified as reference in the readable iterator
<h3>Valid expressions</h3> <h3>Valid expressions</h3>
<Table border> <Table border>
<TR><TH>Name</TH><TH>Expression</TH><TH>Type requirements</TH><TH>Return type</TH></TR> <tr><TH>Name</TH><TH>Expression</TH><TH>Type requirements</TH><TH>Return type</TH></tr>
<TR> <tr>
<TD>Dereference</TD> <td>Dereference</td>
<TD><tt>*x</tt></TD> <td><tt>*x</tt></td>
<TD>&nbsp;</TD> <td>&nbsp;</td>
<TD> <tt>T&amp;</tt> </TD> <td><tt>std::iterator_traits&lt;X&gt;::reference</tt></td>
</TR> </tr>
<TR> <tr>
<TD>Member access</TD> <td>Member access</td>
<TD><tt>x-&gt;m</tt></TD> <td><tt>x-&gt;m</tt></td>
<TD><tt>T</tt> is a type with a member named <tt>m</tt>.</TD> <td><tt>T</tt> is a type with a member named <tt>m</tt>.</td>
<TD> <td>
&nbsp; &nbsp;
</TD> </td>
</tr> </tr>
</table> </table>
-->
<p> <p>
<hr> <hr>
<!--------------------------------------------------------------------------->
<H2><A NAME="concept:SinglePassIterator"></A> <H3><A NAME="concept:ForwardTraversalIterator"></A>
Single-Pass Iterator Forward Traversal Iterator
</H2> </H3>
The Forward Iterator is an iterator that can be incremented. Also, it
is permissible to make multiple passes through the iterator's range.
<h3>Refinement of</h3>
<A href="http://www.boost.org/libs/utility/CopyConstructible.html">Copy Constructible</A>,
<A href="http://www.boost.org/libs/utility/Assignable.html">Assignable</A>,
<A href="http://www.sgi.com/tech/stl/DefaultConstructible.html">Default Constructible</A>, and
<A href="http://www.sgi.com/tech/stl/EqualityComparable.html">Equality Comparable</A>
A Single-Pass Iterator is an iterator that can be incremented to
traverse through a sequence of objects, but the sequence can only be
traversed a single time.
<h3>Associated types</h3> <h3>Associated types</h3>
<Table border> <Table border>
<TR>
<TD>Difference type</TD>
<TD><tt><a href="./iterator_traits.htm">boost::iterator_traits</a>&lt;X&gt;::difference_type</tt></TD>
<TD>
A signed integral type used to represent the distance from one
iterator to another, or the number of elements in a range.
</TD>
</TR>
<TR> <tr>
<TD>Traversal Category</TD> <td>Difference Type</td>
<TD><tt><a href="./iterator_traits.htm">boost::iterator_traits</a>&lt;X&gt;::traversal_category</tt></TD> <td><tt>std::iterator_traits&lt;X&gt;::difference_type</tt></td>
<TD> <td>
A type convertible to <tt>boost::single_pass_iterator_tag</tt> A signed integral type used for representing distances
</TD> between iterators that point into the same range.
</td>
</tr> </tr>
</table> <tr>
<td>Traversal Category</td>
<td><tt>std::traversal_category&lt;X&gt;::type</tt></td>
<td>
A type convertible to <tt>std::forward_traversal_tag</tt>
</td>
</tr>
</Table>
<h3>Valid expressions</h3> <h3>Valid expressions</h3>
<Table border> <Table border>
<TR> <tr>
<TH>Name</TH><TH>Expression</TH><TH>Type requirements</TH> <TH>Name</TH><TH>Expression</TH><TH>Type requirements</TH>
<TH>Return type</TH> <TH>Return type</TH>
</TR> </tr>
<TR> <tr>
<TD>Preincrement</TD> <td>Preincrement</td>
<TD><tt>++i</tt></TD><TD>&nbsp;</TD><TD><tt>X&amp;</tt></TD> <td><tt>++i</tt></td><td>&nbsp;</td><td><tt>X&amp;</tt></td>
</TR> </tr>
<TR> <tr>
<TD>Postincrement</TD> <td>Postincrement</td>
<TD><tt>(void)i++</tt></TD><TD>&nbsp;</TD><TD>&nbsp;</TD> <td><tt>i++</tt></td><td>&nbsp;</td><td>convertible to <tt>const X&amp;</tt></td>
</TR>
</Table>
<p>
<hr>
<H2><A NAME="concept:ForwardIterator"></A>
Forward Iterator
</H2>
The Forward Iterator is an iterator that can be incremented. Also, it
is permissible to make multiple passes through the sequence.
<h3>Refinement of</h3>
<a href="#concept:SinglePassIterator">Single-Pass Iterator</a>
<h3>Associated types</h3>
<Table border>
<TR>
<TD>Traversal Category</TD>
<TD><tt><a href="./iterator_traits.htm">boost::iterator_traits</a>&lt;X&gt;::traversal_category</tt></TD>
<TD>
A type convertible to <tt>boost::forward_iterator_tag</tt>
</TD>
</tr> </tr>
</Table> </Table>
<p> <p>
<hr> <hr>
<!--------------------------------------------------------------------------->
<H2><A NAME="concept:BidirectionalIterator"></A> <H3><A NAME="concept:BidirectionalTraversalIterator"></A>
Bidirectional Iterator Bidirectional Traversal Iterator
</H2> </H3>
An iterator that can be incremented and decremented. An iterator that can be incremented and decremented.
<h3>Refinement of</h3> <h3>Refinement of</h3>
<a href="#concept:ForwardIterator">Forward Iterator</a> <a href="#concept:ForwardTraversalIterator">Forward Traversal Iterator</a>
<h3>Associated types</h3> <h3>Associated types</h3>
<Table border> <Table border>
<TR> <tr>
<TD>Traversal Category</TD> <td>Traversal Category</td>
<TD><tt><a href="./iterator_traits.htm">boost::iterator_traits</a>&lt;X&gt;::traversal_category</tt></TD> <td><tt>std::traversal_category&lt;X&gt;::type</tt></td>
<TD> <td>
A type convertible to <tt>boost::bidirectional_iterator_tag</tt> A type convertible to <tt>std::bidirectional_traversal_tag</tt>
</TD> </td>
</tr> </tr>
</Table> </Table>
<h3>Valid expressions</h3> <h3>Valid expressions</h3>
<Table border> <Table border>
<TR> <tr>
<TH>Name</TH><TH>Expression</TH><TH>Type requirements</TH> <TH>Name</TH><TH>Expression</TH><TH>Type requirements</TH>
<TH>Return type</TH> <TH>Return type</TH>
</TR> </tr>
<TR><TD>Predecrement</TD> <tr><td>Predecrement</td>
<TD><tt>--i</tt></TD><TD>&nbsp;</TD><TD><tt>X&amp;</tt></TD> <td><tt>--i</tt></td><td>&nbsp;</td><td><tt>X&amp;</tt></td>
</TR> </tr>
<TR><TD>Postdecrement</TD> <tr><td>Postdecrement</td>
<TD><tt>i--</tt></TD><TD>&nbsp;</TD><TD><tt>X</tt></TD> <td><tt>i--</tt></td><td>&nbsp;</td><td>convertible to <tt>const X&amp;</tt></td>
</tr> </tr>
</table> </table>
<p> <p>
<hr> <hr>
<!--------------------------------------------------------------------------->
<H2><A NAME="concept:RandomAccessIterator"></A> <H3><A NAME="concept:RandomAccessTraversalIterator"></A>
Random Access Iterator Random Access Traversal Iterator
</H2> </H3>
An iterator that provides constant-time methods for moving forward and An iterator that provides constant-time methods for moving forward and
backward in arbitrary-sized steps backward in arbitrary-sized steps.
<h3>Refinement of</h3> <h3>Refinement of</h3>
<a href="#concept:BidirectionalIterator">Bidirectional Iterator</a> <a href="#concept:BidirectionalTraversalIterator">Bidirectional Traversal Iterator</a> and
<A href="http://www.sgi.com/tech/stl/LessThanComparable.html">Less Than Comparable</A> where <tt>&lt;</tt> is a total ordering
<h3>Associated types</h3> <h3>Associated types</h3>
<Table border> <Table border>
<TR> <tr>
<TD>Traversal Category</TD> <td>Traversal Category</td>
<TD><tt><a href="./iterator_traits.htm">boost::iterator_traits</a>&lt;X&gt;::traversal_category</tt></TD> <td><tt>std::traversal_category&lt;X&gt;::type</tt></td>
<TD> <td>
A type convertible to <tt>boost::random_access_iterator_tag</tt> A type convertible to <tt>std::random_access_traversal_tag</tt>
</TD> </td>
</tr> </tr>
</Table> </Table>
<h3>Valid expressions</h3> <h3>Valid expressions</h3>
<Table border> <Table border>
<TR><TH>Name</TH><TH>Expression</TH><TH>Type requirements</TH> <tr><TH>Name</TH><TH>Expression</TH><TH>Type requirements</TH>
<TH>Return type</TH> <TH>Return type</TH>
</TR> </tr>
<TR><TD>Iterator addition</TD> <tr><td>Iterator addition</td>
<TD><tt>i += n</tt></TD><TD>&nbsp;</TD><TD><tt>X&amp;</tt></TD> <td><tt>i += n</tt></td><td>&nbsp;</td><td><tt>X&amp;</tt></td>
</TR> </tr>
<TR><TD>Iterator addition</TD> <tr><td>Iterator addition</td>
<TD><tt>i + n</tt> or <tt>n + i</tt></TD><TD>&nbsp;</TD><TD><tt>X</tt></TD> <td><tt>i + n</tt> or <tt>n + i</tt></td><td>&nbsp;</td><td><tt>X</tt></td>
</TR> </tr>
<TR><TD>Iterator subtraction</TD> <tr><td>Iterator subtraction</td>
<TD><tt>i -= n</tt></TD><TD>&nbsp;</TD><TD><tt>X&amp;</tt></TD> <td><tt>i -= n</tt></td><td>&nbsp;</td><td><tt>X&amp;</tt></td>
</TR> </tr>
<TR><TD>Iterator subtraction</TD> <tr><td>Iterator subtraction</td>
<TD><tt>i - n</tt></TD><TD>&nbsp;</TD><TD><tt>X</tt></TD> <td><tt>i - n</tt></td><td>&nbsp;</td><td><tt>X</tt></td>
</TR> </tr>
<TR><TD>Difference</TD> <tr><td>Difference</td>
<TD><tt>i - j</tt></TD><TD>&nbsp;</TD><TD><tt><a href="./iterator_traits.htm">boost::iterator_traits</a>&lt;X&gt;::difference_type</tt></TD> <td><tt>i - j</tt></td><td>&nbsp;</td><td><tt>std::iterator_traits&lt;X&gt;::difference_type</tt></td>
</TR> </tr>
<TR><TD>Element operator</TD> <tr><td>Element operator</td>
<TD><tt>i[n]</tt></TD> <td><tt>i[n]</tt></td>
<TD><tt>X</tt> must be a model of <td><tt>X</tt> must also be a model of
<a href="#concept:Readable Iterator">Readable Iterator</a>. </TD> <a href="#concept:ReadableIterator">Readable Iterator</a>. </td>
<TD>The same return type as <tt>*i</tt>.</TD> <td><tt>std::iterator_traits&lt;X&gt;::reference</tt></td>
</TR> </tr>
<TR><TD>Element assignment</TD> <tr><td>Element assignment</td>
<TD><tt>i[n] = t</tt></TD> <td><tt>i[n] = t</tt></td>
<TD><tt>X</tt> must be a model of <td><tt>X</tt> must also be a model of
<a href="#concept:WritableIterator">Writable Iterator</a>.</TD> <a href="#concept:WritableIterator">Writable Iterator</a>.</td>
<TD>unspecified</TD> <td>unspecified</td>
</tr> </tr>
</table> </table>
<p>
<hr>
<HR> <HR>
<TABLE> <TABLE>