[SVN r21672]
This commit is contained in:
Dave Abrahams
2004-01-13 13:36:55 +00:00
parent e5d502d2f8
commit 1033aeb186
3 changed files with 92 additions and 92 deletions

View File

@ -3,11 +3,11 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.2.8: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.3.1: http://docutils.sourceforge.net/" />
<title>Counting Iterator</title> <title>Counting Iterator</title>
<meta name="author" content="David Abrahams, Jeremy Siek, Thomas Witt" /> <meta name="author" content="David Abrahams, Jeremy Siek, Thomas Witt" />
<meta name="organization" content="Boost Consulting, Indiana University Open Systems Lab, University of Hanover Institute for Transport Railway Operation and Construction" /> <meta name="organization" content="Boost Consulting, Indiana University Open Systems Lab, University of Hanover Institute for Transport Railway Operation and Construction" />
<meta name="date" content="2004-01-12" /> <meta name="date" content="2004-01-13" />
<meta name="copyright" content="Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All rights reserved" /> <meta name="copyright" content="Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All rights reserved" />
<link rel="stylesheet" href="default.css" type="text/css" /> <link rel="stylesheet" href="default.css" type="text/css" />
</head> </head>
@ -27,7 +27,7 @@
Lab</a>, University of Hanover <a class="last reference" href="http://www.ive.uni-hannover.de">Institute for Transport Lab</a>, University of Hanover <a class="last reference" href="http://www.ive.uni-hannover.de">Institute for Transport
Railway Operation and Construction</a></td></tr> Railway Operation and Construction</a></td></tr>
<tr><th class="docinfo-name">Date:</th> <tr><th class="docinfo-name">Date:</th>
<td>2004-01-12</td></tr> <td>2004-01-13</td></tr>
<tr><th class="docinfo-name">Copyright:</th> <tr><th class="docinfo-name">Copyright:</th>
<td>Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All rights reserved</td></tr> <td>Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All rights reserved</td></tr>
</tbody> </tbody>
@ -36,21 +36,21 @@ Railway Operation and Construction</a></td></tr>
<col class="field-name" /> <col class="field-name" />
<col class="field-body" /> <col class="field-body" />
<tbody valign="top"> <tbody valign="top">
<tr class="field"><th class="field-name">abstract:</th><td class="field-body">How would you fill up a vector with the numbers zero <tr class="field"><th class="field-name">abstract:</th><td class="field-body"><p class="first">How would you fill up a vector with the numbers zero
through one hundred using <tt class="literal"><span class="pre">std::copy()</span></tt>? The only iterator through one hundred using <tt class="literal"><span class="pre">std::copy()</span></tt>? The only iterator
operation missing from builtin integer types is an operation missing from builtin integer types is an
<tt class="literal"><span class="pre">operator*()</span></tt> that returns the current value of the integer. <tt class="literal"><span class="pre">operator*()</span></tt> that returns the current value of the integer.
The counting iterator adaptor adds this crucial piece of The counting iterator adaptor adds this crucial piece of
functionality to whatever type it wraps. One can use the functionality to whatever type it wraps. One can use the
counting iterator adaptor not only with integer types, but with counting iterator adaptor not only with integer types, but with
any type that is <strong>Incrementable</strong> (see type requirements any incrementable type.</p>
below).</td> <p class="last"><tt class="literal"><span class="pre">counting_iterator</span></tt> adapts an object by adding an <tt class="literal"><span class="pre">operator*</span></tt> that
returns the current value of the object. All other iterator operations
are forwarded to the adapted object.</p>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<p><tt class="literal"><span class="pre">counting_iterator</span></tt> adapts an object by adding an <tt class="literal"><span class="pre">operator*</span></tt> that
returns the current value of the object. All other iterator operations
are forwarded to the adapted object.</p>
<div class="contents topic" id="table-of-contents"> <div class="contents topic" id="table-of-contents">
<p class="topic-title"><a name="table-of-contents">Table of Contents</a></p> <p class="topic-title"><a name="table-of-contents">Table of Contents</a></p>
<ul class="simple"> <ul class="simple">
@ -90,53 +90,53 @@ class counting_iterator
}; };
</pre> </pre>
<p>If the <tt class="literal"><span class="pre">Difference</span></tt> argument is <tt class="literal"><span class="pre">use_default</span></tt> then the <p>If the <tt class="literal"><span class="pre">Difference</span></tt> argument is <tt class="literal"><span class="pre">use_default</span></tt> then the
<tt class="literal"><span class="pre">difference_type</span></tt> member is an implementation defined signed <tt class="literal"><span class="pre">difference_type</span></tt> member is an unspecified signed integral
integral type. Otherwise <tt class="literal"><span class="pre">difference_type</span></tt> is <tt class="literal"><span class="pre">Difference</span></tt>.</p> type. Otherwise <tt class="literal"><span class="pre">difference_type</span></tt> is <tt class="literal"><span class="pre">Difference</span></tt>.</p>
<p>If <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> is not <tt class="literal"><span class="pre">use_default</span></tt> then the member <p>If <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> is not <tt class="literal"><span class="pre">use_default</span></tt> then the member
<tt class="literal"><span class="pre">iterator_category</span></tt> is <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt>. Otherwise, if <tt class="literal"><span class="pre">iterator_category</span></tt> is <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt>. Otherwise, if
<tt class="literal"><span class="pre">Incrementable</span></tt> is a numeric type then <tt class="literal"><span class="pre">iterator_category</span></tt> is a <tt class="literal"><span class="pre">Incrementable</span></tt> is a numberic type <tt class="literal"><span class="pre">iterator_category</span></tt> is a
type convertible to <tt class="literal"><span class="pre">random_access_iterator_tag</span></tt>. If type convertible to <tt class="literal"><span class="pre">random_access_iterator_tag</span></tt>. Otherwise,
<tt class="literal"><span class="pre">Incrementable</span></tt> is not a numeric type then <tt class="literal"><span class="pre">iterator_category</span></tt> is <tt class="literal"><span class="pre">iterator_category</span></tt> is unspecified, and the <tt class="literal"><span class="pre">counting_iterator</span></tt>
<tt class="literal"><span class="pre">iterator_traversal&lt;Incrementable&gt;::type</span></tt>.</p> specialization models the same iterator traversal concepts modeled
by <tt class="literal"><span class="pre">Incrementable</span></tt>.</p>
<dl> <dl>
<dt>[<em>Note:</em> implementers are encouraged to provide an implementation of</dt> <dt>[<em>Note:</em> implementers are encouraged to provide an implementation of</dt>
<dd><tt class="literal"><span class="pre">operator-</span></tt> and a <tt class="literal"><span class="pre">difference_type</span></tt> that avoids overflows in <dd><tt class="literal"><span class="pre">operator-</span></tt> and a <tt class="literal"><span class="pre">difference_type</span></tt> that avoid overflows in
the cases when the <tt class="literal"><span class="pre">Incrementable</span></tt> type is a numeric type.]</dd> the cases when the <tt class="literal"><span class="pre">Incrementable</span></tt> type is a numeric type.]</dd>
</dl> </dl>
</div> </div>
<div class="section" id="counting-iterator-requirements"> <div class="section" id="counting-iterator-requirements">
<h1><a class="toc-backref" href="#id3" name="counting-iterator-requirements"><tt class="literal"><span class="pre">counting_iterator</span></tt> requirements</a></h1> <h1><a class="toc-backref" href="#id3" name="counting-iterator-requirements"><tt class="literal"><span class="pre">counting_iterator</span></tt> requirements</a></h1>
<p>The <tt class="literal"><span class="pre">Incrementable</span></tt> type must be Default Constructible, Copy <p><tt class="literal"><span class="pre">Incrementable</span></tt> must be Default Constructible, Copy
Constructible, and Assignable.</p> Constructible, and Assignable.</p>
<p>If <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to <tt class="literal"><span class="pre">forward_iterator_tag</span></tt> or <p>If <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to <tt class="literal"><span class="pre">forward_iterator_tag</span></tt>
<tt class="literal"><span class="pre">forward_traversal_tag</span></tt> then the following expressions must be valid:</p> or <tt class="literal"><span class="pre">forward_traversal_tag</span></tt>, the following must be well-formed:</p>
<pre class="literal-block"> <pre class="literal-block">
Incrementable i, j; Incrementable i, j;
++i // pre-increment ++i; // pre-increment
i == j // operator equal i == j; // operator equal
</pre> </pre>
<p>If <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to <p>If <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to
<tt class="literal"><span class="pre">bidirectional_iterator_tag</span></tt> or <tt class="literal"><span class="pre">bidirectional_traversal_tag</span></tt> then <tt class="literal"><span class="pre">bidirectional_iterator_tag</span></tt> or <tt class="literal"><span class="pre">bidirectional_traversal_tag</span></tt>,
pre-decrement is required:</p> the following expression must also be well-formed:</p>
<pre class="literal-block"> <pre class="literal-block">
--i --i
</pre> </pre>
<p>If <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to <p>If <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to
<tt class="literal"><span class="pre">random_access_iterator_tag</span></tt> or <tt class="literal"><span class="pre">random_access_traversal_tag</span></tt> then <tt class="literal"><span class="pre">random_access_iterator_tag</span></tt> or <tt class="literal"><span class="pre">random_access_traversal_tag</span></tt>,
these additional expressions are also required:</p> the following must must also be valid:</p>
<pre class="literal-block"> <pre class="literal-block">
counting_iterator::difference_type n; counting_iterator::difference_type n;
i += n i += n;
n = i - j n = i - j;
i &lt; j i &lt; j;
</pre> </pre>
</div> </div>
<div class="section" id="counting-iterator-models"> <div class="section" id="counting-iterator-models">
<h1><a class="toc-backref" href="#id4" name="counting-iterator-models"><tt class="literal"><span class="pre">counting_iterator</span></tt> models</a></h1> <h1><a class="toc-backref" href="#id4" name="counting-iterator-models"><tt class="literal"><span class="pre">counting_iterator</span></tt> models</a></h1>
<p><tt class="literal"><span class="pre">counting_iterator</span></tt> models Readable Lvalue Iterator. In addition, <p>Specializations of <tt class="literal"><span class="pre">counting_iterator</span></tt> model Readable Lvalue
<tt class="literal"><span class="pre">counting_iterator</span></tt> models the concepts corresponding to the Iterator. In addition, they model the concepts corresponding to the
iterator tags that <tt class="literal"><span class="pre">counting_iterator::iterator_category</span></tt> is iterator tags to which their <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible.</p>
convertible to.</p>
</div> </div>
<div class="section" id="counting-iterator-operations"> <div class="section" id="counting-iterator-operations">
<h1><a class="toc-backref" href="#id5" name="counting-iterator-operations"><tt class="literal"><span class="pre">counting_iterator</span></tt> operations</a></h1> <h1><a class="toc-backref" href="#id5" name="counting-iterator-operations"><tt class="literal"><span class="pre">counting_iterator</span></tt> operations</a></h1>
@ -258,10 +258,10 @@ indirectly printing out the numbers from 0 to 7
<p>The source code for this example can be found <a class="reference" href="../example/counting_iterator_example.cpp">here</a>.</p> <p>The source code for this example can be found <a class="reference" href="../example/counting_iterator_example.cpp">here</a>.</p>
</div> </div>
</div> </div>
<hr class="footer"/> <hr class="footer" />
<div class="footer"> <div class="footer">
<a class="reference" href="counting_iterator.rst">View document source</a>. <a class="reference" href="counting_iterator.rst">View document source</a>.
Generated on: 2004-01-13 05:45 UTC. Generated on: 2004-01-13 13:15 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div> </div>
</body> </body>

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.2.8: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.3.1: http://docutils.sourceforge.net/" />
<title>Iterator Facade and Adaptor</title> <title>Iterator Facade and Adaptor</title>
<meta name="author" content="David Abrahams, Jeremy Siek, Thomas Witt" /> <meta name="author" content="David Abrahams, Jeremy Siek, Thomas Witt" />
<meta name="organization" content="Boost Consulting, Indiana University Open Systems Lab, University of Hanover Institute for Transport Railway Operation and Construction" /> <meta name="organization" content="Boost Consulting, Indiana University Open Systems Lab, University of Hanover Institute for Transport Railway Operation and Construction" />
@ -326,7 +326,7 @@ of the derived iterator type. These member functions are described
briefly below and in more detail in the iterator facade briefly below and in more detail in the iterator facade
requirements.</p> requirements.</p>
<blockquote> <blockquote>
<table class="table" frame="border" rules="all"> <table border class="table">
<colgroup> <colgroup>
<col width="44%" /> <col width="44%" />
<col width="56%" /> <col width="56%" />
@ -725,7 +725,7 @@ is a constant object of a random access traversal iterator type
interoperable with <tt class="literal"><span class="pre">X</span></tt>.</p> interoperable with <tt class="literal"><span class="pre">X</span></tt>.</p>
<a class="target" id="core-operations" name="core-operations"></a><div class="topic"> <a class="target" id="core-operations" name="core-operations"></a><div class="topic">
<p class="topic-title"><tt class="literal"><span class="pre">iterator_facade</span></tt> Core Operations</p> <p class="topic-title"><tt class="literal"><span class="pre">iterator_facade</span></tt> Core Operations</p>
<table class="table" frame="border" rules="all"> <table border class="table">
<colgroup> <colgroup>
<col width="19%" /> <col width="19%" />
<col width="21%" /> <col width="21%" />
@ -1515,23 +1515,23 @@ else
</div> </div>
<div class="section" id="reverse-iterator-requirements"> <div class="section" id="reverse-iterator-requirements">
<h4><a class="toc-backref" href="#id48" name="reverse-iterator-requirements"><tt class="literal"><span class="pre">reverse_iterator</span></tt> requirements</a></h4> <h4><a class="toc-backref" href="#id48" name="reverse-iterator-requirements"><tt class="literal"><span class="pre">reverse_iterator</span></tt> requirements</a></h4>
<p>The base <tt class="literal"><span class="pre">Iterator</span></tt> must be a model of Bidirectional Traversal <p><tt class="literal"><span class="pre">Iterator</span></tt> must be a model of Bidirectional Traversal Iterator
Iterator and Readable Iterator.</p> and Readable Iterator.</p>
</div> </div>
<div class="section" id="reverse-iterator-models"> <div class="section" id="reverse-iterator-models">
<h4><a class="toc-backref" href="#id49" name="reverse-iterator-models"><tt class="literal"><span class="pre">reverse_iterator</span></tt> models</a></h4> <h4><a class="toc-backref" href="#id49" name="reverse-iterator-models"><tt class="literal"><span class="pre">reverse_iterator</span></tt> models</a></h4>
<p><tt class="literal"><span class="pre">reverse_iterator</span></tt> models the same standard traversal and access <p>A specialization of <tt class="literal"><span class="pre">reverse_iterator</span></tt> models the same standard
iterator concepts that the <tt class="literal"><span class="pre">Iterator</span></tt> argument models. In addition, traversal and access iterator concepts modeled by its <tt class="literal"><span class="pre">Iterator</span></tt>
<tt class="literal"><span class="pre">reverse_iterator</span></tt> models the old iterator concepts specified in the argument. In addition, it models the old iterator concepts
following table, depnding on what the <tt class="literal"><span class="pre">Iterator</span></tt> argument models.</p> specified in the following table:</p>
<table class="table" frame="border" rules="all"> <table border class="table">
<colgroup> <colgroup>
<col width="62%" /> <col width="53%" />
<col width="38%" /> <col width="47%" />
</colgroup> </colgroup>
<thead valign="bottom"> <thead valign="bottom">
<tr><th>If <tt class="literal"><span class="pre">Iterator</span></tt> models</th> <tr><th>If <tt class="literal"><span class="pre">I</span></tt> models</th>
<th>then <tt class="literal"><span class="pre">reverse_iterator</span></tt> models</th> <th>then <tt class="literal"><span class="pre">reverse_iterator&lt;I&gt;</span></tt> models</th>
</tr> </tr>
</thead> </thead>
<tbody valign="top"> <tbody valign="top">
@ -1728,7 +1728,7 @@ concept that is modeled by the <tt class="literal"><span class="pre">Iterator</s
<p>If <tt class="literal"><span class="pre">transform_iterator</span></tt> is a model of Readable Lvalue Iterator then <p>If <tt class="literal"><span class="pre">transform_iterator</span></tt> is a model of Readable Lvalue Iterator then
it models the following original iterator concepts depending on what it models the following original iterator concepts depending on what
the <tt class="literal"><span class="pre">Iterator</span></tt> argument models.</p> the <tt class="literal"><span class="pre">Iterator</span></tt> argument models.</p>
<table class="table" frame="border" rules="all"> <table border class="table">
<colgroup> <colgroup>
<col width="51%" /> <col width="51%" />
<col width="49%" /> <col width="49%" />
@ -1919,7 +1919,7 @@ Input Iterator.</p>
<p>The concepts that <tt class="literal"><span class="pre">filter_iterator</span></tt> models are dependent on which <p>The concepts that <tt class="literal"><span class="pre">filter_iterator</span></tt> models are dependent on which
concepts the <tt class="literal"><span class="pre">Iterator</span></tt> argument models, as specified in the concepts the <tt class="literal"><span class="pre">Iterator</span></tt> argument models, as specified in the
following tables.</p> following tables.</p>
<table class="table" frame="border" rules="all"> <table border class="table">
<colgroup> <colgroup>
<col width="33%" /> <col width="33%" />
<col width="67%" /> <col width="67%" />
@ -1938,7 +1938,7 @@ following tables.</p>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<table class="table" frame="border" rules="all"> <table border class="table">
<colgroup> <colgroup>
<col width="41%" /> <col width="41%" />
<col width="59%" /> <col width="59%" />
@ -1960,7 +1960,7 @@ following tables.</p>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<table class="table" frame="border" rules="all"> <table border class="table">
<colgroup> <colgroup>
<col width="63%" /> <col width="63%" />
<col width="38%" /> <col width="38%" />
@ -2127,53 +2127,53 @@ class counting_iterator
}; };
</pre> </pre>
<p>If the <tt class="literal"><span class="pre">Difference</span></tt> argument is <tt class="literal"><span class="pre">use_default</span></tt> then the <p>If the <tt class="literal"><span class="pre">Difference</span></tt> argument is <tt class="literal"><span class="pre">use_default</span></tt> then the
<tt class="literal"><span class="pre">difference_type</span></tt> member is an implementation defined signed <tt class="literal"><span class="pre">difference_type</span></tt> member is an unspecified signed integral
integral type. Otherwise <tt class="literal"><span class="pre">difference_type</span></tt> is <tt class="literal"><span class="pre">Difference</span></tt>.</p> type. Otherwise <tt class="literal"><span class="pre">difference_type</span></tt> is <tt class="literal"><span class="pre">Difference</span></tt>.</p>
<p>If <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> is not <tt class="literal"><span class="pre">use_default</span></tt> then the member <p>If <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> is not <tt class="literal"><span class="pre">use_default</span></tt> then the member
<tt class="literal"><span class="pre">iterator_category</span></tt> is <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt>. Otherwise, if <tt class="literal"><span class="pre">iterator_category</span></tt> is <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt>. Otherwise, if
<tt class="literal"><span class="pre">Incrementable</span></tt> is a numeric type then <tt class="literal"><span class="pre">iterator_category</span></tt> is a <tt class="literal"><span class="pre">Incrementable</span></tt> is a numberic type <tt class="literal"><span class="pre">iterator_category</span></tt> is a
type convertible to <tt class="literal"><span class="pre">random_access_iterator_tag</span></tt>. If type convertible to <tt class="literal"><span class="pre">random_access_iterator_tag</span></tt>. Otherwise,
<tt class="literal"><span class="pre">Incrementable</span></tt> is not a numeric type then <tt class="literal"><span class="pre">iterator_category</span></tt> is <tt class="literal"><span class="pre">iterator_category</span></tt> is unspecified, and the <tt class="literal"><span class="pre">counting_iterator</span></tt>
<tt class="literal"><span class="pre">iterator_traversal&lt;Incrementable&gt;::type</span></tt>.</p> specialization models the same iterator traversal concepts modeled
by <tt class="literal"><span class="pre">Incrementable</span></tt>.</p>
<dl> <dl>
<dt>[<em>Note:</em> implementers are encouraged to provide an implementation of</dt> <dt>[<em>Note:</em> implementers are encouraged to provide an implementation of</dt>
<dd><tt class="literal"><span class="pre">operator-</span></tt> and a <tt class="literal"><span class="pre">difference_type</span></tt> that avoids overflows in <dd><tt class="literal"><span class="pre">operator-</span></tt> and a <tt class="literal"><span class="pre">difference_type</span></tt> that avoid overflows in
the cases when the <tt class="literal"><span class="pre">Incrementable</span></tt> type is a numeric type.]</dd> the cases when the <tt class="literal"><span class="pre">Incrementable</span></tt> type is a numeric type.]</dd>
</dl> </dl>
</div> </div>
<div class="section" id="counting-iterator-requirements"> <div class="section" id="counting-iterator-requirements">
<h4><a class="toc-backref" href="#id63" name="counting-iterator-requirements"><tt class="literal"><span class="pre">counting_iterator</span></tt> requirements</a></h4> <h4><a class="toc-backref" href="#id63" name="counting-iterator-requirements"><tt class="literal"><span class="pre">counting_iterator</span></tt> requirements</a></h4>
<p>The <tt class="literal"><span class="pre">Incrementable</span></tt> type must be Default Constructible, Copy <p><tt class="literal"><span class="pre">Incrementable</span></tt> must be Default Constructible, Copy
Constructible, and Assignable.</p> Constructible, and Assignable.</p>
<p>If <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to <tt class="literal"><span class="pre">forward_iterator_tag</span></tt> or <p>If <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to <tt class="literal"><span class="pre">forward_iterator_tag</span></tt>
<tt class="literal"><span class="pre">forward_traversal_tag</span></tt> then the following expressions must be valid:</p> or <tt class="literal"><span class="pre">forward_traversal_tag</span></tt>, the following must be well-formed:</p>
<pre class="literal-block"> <pre class="literal-block">
Incrementable i, j; Incrementable i, j;
++i // pre-increment ++i; // pre-increment
i == j // operator equal i == j; // operator equal
</pre> </pre>
<p>If <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to <p>If <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to
<tt class="literal"><span class="pre">bidirectional_iterator_tag</span></tt> or <tt class="literal"><span class="pre">bidirectional_traversal_tag</span></tt> then <tt class="literal"><span class="pre">bidirectional_iterator_tag</span></tt> or <tt class="literal"><span class="pre">bidirectional_traversal_tag</span></tt>,
pre-decrement is required:</p> the following expression must also be well-formed:</p>
<pre class="literal-block"> <pre class="literal-block">
--i --i
</pre> </pre>
<p>If <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to <p>If <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible to
<tt class="literal"><span class="pre">random_access_iterator_tag</span></tt> or <tt class="literal"><span class="pre">random_access_traversal_tag</span></tt> then <tt class="literal"><span class="pre">random_access_iterator_tag</span></tt> or <tt class="literal"><span class="pre">random_access_traversal_tag</span></tt>,
these additional expressions are also required:</p> the following must must also be valid:</p>
<pre class="literal-block"> <pre class="literal-block">
counting_iterator::difference_type n; counting_iterator::difference_type n;
i += n i += n;
n = i - j n = i - j;
i &lt; j i &lt; j;
</pre> </pre>
</div> </div>
<div class="section" id="counting-iterator-models"> <div class="section" id="counting-iterator-models">
<h4><a class="toc-backref" href="#id64" name="counting-iterator-models"><tt class="literal"><span class="pre">counting_iterator</span></tt> models</a></h4> <h4><a class="toc-backref" href="#id64" name="counting-iterator-models"><tt class="literal"><span class="pre">counting_iterator</span></tt> models</a></h4>
<p><tt class="literal"><span class="pre">counting_iterator</span></tt> models Readable Lvalue Iterator. In addition, <p>Specializations of <tt class="literal"><span class="pre">counting_iterator</span></tt> model Readable Lvalue
<tt class="literal"><span class="pre">counting_iterator</span></tt> models the concepts corresponding to the Iterator. In addition, they model the concepts corresponding to the
iterator tags that <tt class="literal"><span class="pre">counting_iterator::iterator_category</span></tt> is iterator tags to which their <tt class="literal"><span class="pre">iterator_category</span></tt> is convertible.</p>
convertible to.</p>
</div> </div>
<div class="section" id="counting-iterator-operations"> <div class="section" id="counting-iterator-operations">
<h4><a class="toc-backref" href="#id65" name="counting-iterator-operations"><tt class="literal"><span class="pre">counting_iterator</span></tt> operations</a></h4> <h4><a class="toc-backref" href="#id65" name="counting-iterator-operations"><tt class="literal"><span class="pre">counting_iterator</span></tt> operations</a></h4>
@ -2282,7 +2282,7 @@ private:
</div> </div>
<div class="section" id="function-output-iterator-requirements"> <div class="section" id="function-output-iterator-requirements">
<h4><a class="toc-backref" href="#id68" name="function-output-iterator-requirements"><tt class="literal"><span class="pre">function_output_iterator</span></tt> requirements</a></h4> <h4><a class="toc-backref" href="#id68" name="function-output-iterator-requirements"><tt class="literal"><span class="pre">function_output_iterator</span></tt> requirements</a></h4>
<p>The <tt class="literal"><span class="pre">UnaryFunction</span></tt> must be Assignable, Copy Constructible.</p> <p><tt class="literal"><span class="pre">UnaryFunction</span></tt> must be Assignable and Copy Constructible.</p>
</div> </div>
<div class="section" id="function-output-iterator-models"> <div class="section" id="function-output-iterator-models">
<h4><a class="toc-backref" href="#id69" name="function-output-iterator-models"><tt class="literal"><span class="pre">function_output_iterator</span></tt> models</a></h4> <h4><a class="toc-backref" href="#id69" name="function-output-iterator-models"><tt class="literal"><span class="pre">function_output_iterator</span></tt> models</a></h4>
@ -2342,10 +2342,10 @@ LocalWords: OtherIncrementable Coplien -->
</div> </div>
</div> </div>
</div> </div>
<hr class="footer"/> <hr class="footer" />
<div class="footer"> <div class="footer">
<a class="reference" href="facade-and-adaptor.rst">View document source</a>. <a class="reference" href="facade-and-adaptor.rst">View document source</a>.
Generated on: 2004-01-13 05:55 UTC. Generated on: 2004-01-13 13:31 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div> </div>
</body> </body>

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.2.8: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.3.1: http://docutils.sourceforge.net/" />
<title>Reverse Iterator</title> <title>Reverse Iterator</title>
<meta name="author" content="David Abrahams, Jeremy Siek, Thomas Witt" /> <meta name="author" content="David Abrahams, Jeremy Siek, Thomas Witt" />
<meta name="organization" content="Boost Consulting, Indiana University Open Systems Lab, University of Hanover Institute for Transport Railway Operation and Construction" /> <meta name="organization" content="Boost Consulting, Indiana University Open Systems Lab, University of Hanover Institute for Transport Railway Operation and Construction" />
@ -97,23 +97,23 @@ else
</div> </div>
<div class="section" id="reverse-iterator-requirements"> <div class="section" id="reverse-iterator-requirements">
<h1><a class="toc-backref" href="#id3" name="reverse-iterator-requirements"><tt class="literal"><span class="pre">reverse_iterator</span></tt> requirements</a></h1> <h1><a class="toc-backref" href="#id3" name="reverse-iterator-requirements"><tt class="literal"><span class="pre">reverse_iterator</span></tt> requirements</a></h1>
<p>The base <tt class="literal"><span class="pre">Iterator</span></tt> must be a model of Bidirectional Traversal <p><tt class="literal"><span class="pre">Iterator</span></tt> must be a model of Bidirectional Traversal Iterator
Iterator and Readable Iterator.</p> and Readable Iterator.</p>
</div> </div>
<div class="section" id="reverse-iterator-models"> <div class="section" id="reverse-iterator-models">
<h1><a class="toc-backref" href="#id4" name="reverse-iterator-models"><tt class="literal"><span class="pre">reverse_iterator</span></tt> models</a></h1> <h1><a class="toc-backref" href="#id4" name="reverse-iterator-models"><tt class="literal"><span class="pre">reverse_iterator</span></tt> models</a></h1>
<p><tt class="literal"><span class="pre">reverse_iterator</span></tt> models the same standard traversal and access <p>A specialization of <tt class="literal"><span class="pre">reverse_iterator</span></tt> models the same standard
iterator concepts that the <tt class="literal"><span class="pre">Iterator</span></tt> argument models. In addition, traversal and access iterator concepts modeled by its <tt class="literal"><span class="pre">Iterator</span></tt>
<tt class="literal"><span class="pre">reverse_iterator</span></tt> models the old iterator concepts specified in the argument. In addition, it models the old iterator concepts
following table, depnding on what the <tt class="literal"><span class="pre">Iterator</span></tt> argument models.</p> specified in the following table:</p>
<table class="table" frame="border" rules="all"> <table border class="table">
<colgroup> <colgroup>
<col width="62%" /> <col width="53%" />
<col width="38%" /> <col width="47%" />
</colgroup> </colgroup>
<thead valign="bottom"> <thead valign="bottom">
<tr><th>If <tt class="literal"><span class="pre">Iterator</span></tt> models</th> <tr><th>If <tt class="literal"><span class="pre">I</span></tt> models</th>
<th>then <tt class="literal"><span class="pre">reverse_iterator</span></tt> models</th> <th>then <tt class="literal"><span class="pre">reverse_iterator&lt;I&gt;</span></tt> models</th>
</tr> </tr>
</thead> </thead>
<tbody valign="top"> <tbody valign="top">
@ -274,10 +274,10 @@ sequence in double-reversed (normal) order: hello world!
<p>The source code for this example can be found <a class="reference" href="../example/reverse_iterator_example.cpp">here</a>.</p> <p>The source code for this example can be found <a class="reference" href="../example/reverse_iterator_example.cpp">here</a>.</p>
</div> </div>
</div> </div>
<hr class="footer"/> <hr class="footer" />
<div class="footer"> <div class="footer">
<a class="reference" href="reverse_iterator.rst">View document source</a>. <a class="reference" href="reverse_iterator.rst">View document source</a>.
Generated on: 2004-01-13 05:39 UTC. Generated on: 2004-01-13 13:15 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div> </div>
</body> </body>