added links to example source code

[SVN r21632]
This commit is contained in:
Jeremy Siek
2004-01-12 16:10:29 +00:00
parent a7eaa017b1
commit 129815f3dd
12 changed files with 95 additions and 59 deletions

View File

@ -45,15 +45,15 @@ adding an <tt class="literal"><span class="pre">operator*</span></tt> that retur
<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">
<li><a class="reference" href="#counting-iterator-synopsis" id="id1" name="id1"><tt class="literal"><span class="pre">counting_iterator</span></tt> synopsis</a></li> <li><a class="reference" href="#counting-iterator-synopsis" id="id2" name="id2"><tt class="literal"><span class="pre">counting_iterator</span></tt> synopsis</a></li>
<li><a class="reference" href="#counting-iterator-requirements" id="id2" name="id2"><tt class="literal"><span class="pre">counting_iterator</span></tt> requirements</a></li> <li><a class="reference" href="#counting-iterator-requirements" id="id3" name="id3"><tt class="literal"><span class="pre">counting_iterator</span></tt> requirements</a></li>
<li><a class="reference" href="#counting-iterator-models" id="id3" name="id3"><tt class="literal"><span class="pre">counting_iterator</span></tt> models</a></li> <li><a class="reference" href="#counting-iterator-models" id="id4" name="id4"><tt class="literal"><span class="pre">counting_iterator</span></tt> models</a></li>
<li><a class="reference" href="#counting-iterator-operations" id="id4" name="id4"><tt class="literal"><span class="pre">counting_iterator</span></tt> operations</a></li> <li><a class="reference" href="#counting-iterator-operations" id="id5" name="id5"><tt class="literal"><span class="pre">counting_iterator</span></tt> operations</a></li>
<li><a class="reference" href="#example" id="id5" name="id5">Example</a></li> <li><a class="reference" href="#example" id="id6" name="id6">Example</a></li>
</ul> </ul>
</div> </div>
<div class="section" id="counting-iterator-synopsis"> <div class="section" id="counting-iterator-synopsis">
<h1><a class="toc-backref" href="#id1" name="counting-iterator-synopsis"><tt class="literal"><span class="pre">counting_iterator</span></tt> synopsis</a></h1> <h1><a class="toc-backref" href="#id2" name="counting-iterator-synopsis"><tt class="literal"><span class="pre">counting_iterator</span></tt> synopsis</a></h1>
<pre class="literal-block"> <pre class="literal-block">
template &lt; template &lt;
class Incrementable class Incrementable
@ -81,13 +81,13 @@ the cases when the <tt class="literal"><span class="pre">Incrementable</span></t
</dl> </dl>
</div> </div>
<div class="section" id="counting-iterator-requirements"> <div class="section" id="counting-iterator-requirements">
<h1><a class="toc-backref" href="#id2" 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>The <tt class="literal"><span class="pre">Incrementable</span></tt> type must be Default Constructible, Copy
Constructible, and Assignable. The default distance is Constructible, and Assignable. The default distance is
an implementation defined signed integral type.</p> an implementation defined signed integral type.</p>
</div> </div>
<div class="section" id="counting-iterator-models"> <div class="section" id="counting-iterator-models">
<h1><a class="toc-backref" href="#id3" 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.</p> <p><tt class="literal"><span class="pre">counting_iterator</span></tt> models Readable Lvalue Iterator.</p>
<p>Furthermore, if you wish to create a counting iterator that is a Forward <p>Furthermore, if you wish to create a counting iterator that is a Forward
Traversal Iterator, then the following expressions must be valid:</p> Traversal Iterator, then the following expressions must be valid:</p>
@ -112,7 +112,7 @@ i &lt; j
</pre> </pre>
</div> </div>
<div class="section" id="counting-iterator-operations"> <div class="section" id="counting-iterator-operations">
<h1><a class="toc-backref" href="#id4" 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>
<p>In addition to the operations required by the concepts modeled by <p>In addition to the operations required by the concepts modeled by
<tt class="literal"><span class="pre">counting_iterator</span></tt>, <tt class="literal"><span class="pre">counting_iterator</span></tt> provides the following <tt class="literal"><span class="pre">counting_iterator</span></tt>, <tt class="literal"><span class="pre">counting_iterator</span></tt> provides the following
operations.</p> operations.</p>
@ -199,7 +199,7 @@ with <tt class="literal"><span class="pre">current</span></tt> constructed from
</table> </table>
</div> </div>
<div class="section" id="example"> <div class="section" id="example">
<h1><a class="toc-backref" href="#id5" name="example">Example</a></h1> <h1><a class="toc-backref" href="#id6" name="example">Example</a></h1>
<p>This example fills an array with numbers and a second array with <p>This example fills an array with numbers and a second array with
pointers into the first array, using <tt class="literal"><span class="pre">counting_iterator</span></tt> for both pointers into the first array, using <tt class="literal"><span class="pre">counting_iterator</span></tt> for both
tasks. Finally <tt class="literal"><span class="pre">indirect_iterator</span></tt> is used to print out the numbers tasks. Finally <tt class="literal"><span class="pre">indirect_iterator</span></tt> is used to print out the numbers
@ -229,12 +229,13 @@ std::cout &lt;&lt; std::endl;
indirectly printing out the numbers from 0 to 7 indirectly printing out the numbers from 0 to 7
0 1 2 3 4 5 6 0 1 2 3 4 5 6
</pre> </pre>
<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-12 15:46 UTC. Generated on: 2004-01-12 16:05 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

@ -33,3 +33,8 @@ The output is::
indirectly printing out the numbers from 0 to 7 indirectly printing out the numbers from 0 to 7
0 1 2 3 4 5 6 0 1 2 3 4 5 6
The source code for this example can be found `here`__.
__ ../example/counting_iterator_example.cpp

View File

@ -63,3 +63,7 @@ The output is::
4 5 8 4 5 8
0 -1 4 5 8 0 -1 4 5 8
The source code for this example can be found `here`__.
__ ../example/filter_iterator_example.cpp

View File

@ -50,15 +50,15 @@ iterators over smart pointers, which the impl handles. -JGS -->
<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">
<li><a class="reference" href="#indirect-iterator-synopsis" id="id1" name="id1"><tt class="literal"><span class="pre">indirect_iterator</span></tt> synopsis</a></li> <li><a class="reference" href="#indirect-iterator-synopsis" id="id2" name="id2"><tt class="literal"><span class="pre">indirect_iterator</span></tt> synopsis</a></li>
<li><a class="reference" href="#indirect-iterator-requirements" id="id2" name="id2"><tt class="literal"><span class="pre">indirect_iterator</span></tt> requirements</a></li> <li><a class="reference" href="#indirect-iterator-requirements" id="id3" name="id3"><tt class="literal"><span class="pre">indirect_iterator</span></tt> requirements</a></li>
<li><a class="reference" href="#indirect-iterator-models" id="id3" name="id3"><tt class="literal"><span class="pre">indirect_iterator</span></tt> models</a></li> <li><a class="reference" href="#indirect-iterator-models" id="id4" name="id4"><tt class="literal"><span class="pre">indirect_iterator</span></tt> models</a></li>
<li><a class="reference" href="#indirect-iterator-operations" id="id4" name="id4"><tt class="literal"><span class="pre">indirect_iterator</span></tt> operations</a></li> <li><a class="reference" href="#indirect-iterator-operations" id="id5" name="id5"><tt class="literal"><span class="pre">indirect_iterator</span></tt> operations</a></li>
<li><a class="reference" href="#example" id="id5" name="id5">Example</a></li> <li><a class="reference" href="#example" id="id6" name="id6">Example</a></li>
</ul> </ul>
</div> </div>
<div class="section" id="indirect-iterator-synopsis"> <div class="section" id="indirect-iterator-synopsis">
<h1><a class="toc-backref" href="#id1" name="indirect-iterator-synopsis"><tt class="literal"><span class="pre">indirect_iterator</span></tt> synopsis</a></h1> <h1><a class="toc-backref" href="#id2" name="indirect-iterator-synopsis"><tt class="literal"><span class="pre">indirect_iterator</span></tt> synopsis</a></h1>
<pre class="literal-block"> <pre class="literal-block">
template &lt; template &lt;
class Iterator class Iterator
@ -130,7 +130,7 @@ satisfies the requirements of the concepts modeled by the indirect
iterator as specified in the models section.</p> iterator as specified in the models section.</p>
</div> </div>
<div class="section" id="indirect-iterator-requirements"> <div class="section" id="indirect-iterator-requirements">
<h1><a class="toc-backref" href="#id2" name="indirect-iterator-requirements"><tt class="literal"><span class="pre">indirect_iterator</span></tt> requirements</a></h1> <h1><a class="toc-backref" href="#id3" name="indirect-iterator-requirements"><tt class="literal"><span class="pre">indirect_iterator</span></tt> requirements</a></h1>
<p>The <tt class="literal"><span class="pre">Iterator</span></tt> argument shall meet the requirements of Readable <p>The <tt class="literal"><span class="pre">Iterator</span></tt> argument shall meet the requirements of Readable
Iterator. The <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> argument shall be one of the Iterator. The <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> argument shall be one of the
standard iterator tags or <tt class="literal"><span class="pre">use_default</span></tt>. If <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> standard iterator tags or <tt class="literal"><span class="pre">use_default</span></tt>. If <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt>
@ -146,7 +146,7 @@ is not <tt class="literal"><span class="pre">use_default</span></tt>, as implied
default for the <tt class="literal"><span class="pre">value_type</span></tt> member.</p> default for the <tt class="literal"><span class="pre">value_type</span></tt> member.</p>
</div> </div>
<div class="section" id="indirect-iterator-models"> <div class="section" id="indirect-iterator-models">
<h1><a class="toc-backref" href="#id3" name="indirect-iterator-models"><tt class="literal"><span class="pre">indirect_iterator</span></tt> models</a></h1> <h1><a class="toc-backref" href="#id4" name="indirect-iterator-models"><tt class="literal"><span class="pre">indirect_iterator</span></tt> models</a></h1>
<p>If <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> is a standard iterator tag, <p>If <tt class="literal"><span class="pre">CategoryOrTraversal</span></tt> is a standard iterator tag,
<tt class="literal"><span class="pre">indirect_iterator</span></tt> is a model of the iterator concept corresponding <tt class="literal"><span class="pre">indirect_iterator</span></tt> is a model of the iterator concept corresponding
to the tag, otherwise <tt class="literal"><span class="pre">indirect_iterator</span></tt> satisfies the requirements to the tag, otherwise <tt class="literal"><span class="pre">indirect_iterator</span></tt> satisfies the requirements
@ -160,7 +160,7 @@ the <tt class="literal"><span class="pre">Iterator</span></tt> argument.</p>
<tt class="literal"><span class="pre">indirect_iterator</span></tt> models Lvalue Iterator.</p> <tt class="literal"><span class="pre">indirect_iterator</span></tt> models Lvalue Iterator.</p>
</div> </div>
<div class="section" id="indirect-iterator-operations"> <div class="section" id="indirect-iterator-operations">
<h1><a class="toc-backref" href="#id4" name="indirect-iterator-operations"><tt class="literal"><span class="pre">indirect_iterator</span></tt> operations</a></h1> <h1><a class="toc-backref" href="#id5" name="indirect-iterator-operations"><tt class="literal"><span class="pre">indirect_iterator</span></tt> operations</a></h1>
<p>In addition to the operations required by the concepts modeled by <p>In addition to the operations required by the concepts modeled by
<tt class="literal"><span class="pre">indirect_iterator</span></tt>, <tt class="literal"><span class="pre">indirect_iterator</span></tt> provides the following <tt class="literal"><span class="pre">indirect_iterator</span></tt>, <tt class="literal"><span class="pre">indirect_iterator</span></tt> provides the following
operations.</p> operations.</p>
@ -251,7 +251,7 @@ indirect_iterator(
</table> </table>
</div> </div>
<div class="section" id="example"> <div class="section" id="example">
<h1><a class="toc-backref" href="#id5" name="example">Example</a></h1> <h1><a class="toc-backref" href="#id6" name="example">Example</a></h1>
<p>This example prints an array of characters, using <p>This example prints an array of characters, using
<tt class="literal"><span class="pre">indirect_iterator</span></tt> to access the array of characters through an <tt class="literal"><span class="pre">indirect_iterator</span></tt> to access the array of characters through an
array of pointers. Next <tt class="literal"><span class="pre">indirect_iterator</span></tt> is used with the array of pointers. Next <tt class="literal"><span class="pre">indirect_iterator</span></tt> is used with the
@ -309,12 +309,13 @@ a,b,c,d,e,f,g,
b,c,d,e,f,g,h, b,c,d,e,f,g,h,
a,b,c,d,e,f,g, a,b,c,d,e,f,g,
</pre> </pre>
<p>The source code for this example can be found <a class="reference" href="../example/indirect_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="indirect_iterator.rst">View document source</a>. <a class="reference" href="indirect_iterator.rst">View document source</a>.
Generated on: 2004-01-12 15:51 UTC. Generated on: 2004-01-12 16:04 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

@ -62,3 +62,8 @@ The output is::
b,c,d,e,f,g,h, b,c,d,e,f,g,h,
a,b,c,d,e,f,g, a,b,c,d,e,f,g,
The source code for this example can be found `here`__.
__ ../example/indirect_iterator_example.cpp

View File

@ -45,17 +45,17 @@ in a potentially different order.</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">
<li><a class="reference" href="#introduction" id="id4" name="id4">Introduction</a></li> <li><a class="reference" href="#introduction" id="id5" name="id5">Introduction</a></li>
<li><a class="reference" href="#reference" id="id5" name="id5">Reference</a><ul> <li><a class="reference" href="#reference" id="id6" name="id6">Reference</a><ul>
<li><a class="reference" href="#permutation-iterator-requirements" id="id6" name="id6"><tt class="literal"><span class="pre">permutation_iterator</span></tt> requirements</a></li> <li><a class="reference" href="#permutation-iterator-requirements" id="id7" name="id7"><tt class="literal"><span class="pre">permutation_iterator</span></tt> requirements</a></li>
<li><a class="reference" href="#permutation-iterator-operations" id="id7" name="id7"><tt class="literal"><span class="pre">permutation_iterator</span></tt> operations</a></li> <li><a class="reference" href="#permutation-iterator-operations" id="id8" name="id8"><tt class="literal"><span class="pre">permutation_iterator</span></tt> operations</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference" href="#example" id="id8" name="id8">Example</a></li> <li><a class="reference" href="#example" id="id9" name="id9">Example</a></li>
</ul> </ul>
</div> </div>
<div class="section" id="introduction"> <div class="section" id="introduction">
<h1><a class="toc-backref" href="#id4" name="introduction">Introduction</a></h1> <h1><a class="toc-backref" href="#id5" name="introduction">Introduction</a></h1>
<p>The adaptor takes two arguments:</p> <p>The adaptor takes two arguments:</p>
<blockquote> <blockquote>
<ul class="simple"> <ul class="simple">
@ -75,7 +75,7 @@ end permutation iterator is completely defined by means of the
past-the-end iterator to the indices.</p> past-the-end iterator to the indices.</p>
</div> </div>
<div class="section" id="reference"> <div class="section" id="reference">
<h1><a class="toc-backref" href="#id5" name="reference">Reference</a></h1> <h1><a class="toc-backref" href="#id6" name="reference">Reference</a></h1>
<pre class="literal-block"> <pre class="literal-block">
template&lt; class ElementIterator template&lt; class ElementIterator
, class IndexIterator , class IndexIterator
@ -105,14 +105,14 @@ permutation_iterator&lt;ElementIterator, IndexIterator&gt;
make_permutation_iterator( ElementIterator e, IndexIterator i); make_permutation_iterator( ElementIterator e, IndexIterator i);
</pre> </pre>
<div class="section" id="permutation-iterator-requirements"> <div class="section" id="permutation-iterator-requirements">
<h2><a class="toc-backref" href="#id6" name="permutation-iterator-requirements"><tt class="literal"><span class="pre">permutation_iterator</span></tt> requirements</a></h2> <h2><a class="toc-backref" href="#id7" name="permutation-iterator-requirements"><tt class="literal"><span class="pre">permutation_iterator</span></tt> requirements</a></h2>
<p><tt class="literal"><span class="pre">ElementIterator</span></tt> must be a model of <a class="reference" href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>. <p><tt class="literal"><span class="pre">ElementIterator</span></tt> must be a model of <a class="reference" href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>.
<tt class="literal"><span class="pre">IndexIterator</span></tt> must at least be a model <a class="reference" href="http://www.sgi.com/tech/stl/ForwardIterator.html">ForwardIterator</a>. The <tt class="literal"><span class="pre">IndexIterator</span></tt> must at least be a model <a class="reference" href="http://www.sgi.com/tech/stl/ForwardIterator.html">ForwardIterator</a>. The
value type of the <tt class="literal"><span class="pre">IndexIterator</span></tt> must be convertible to the value type of the <tt class="literal"><span class="pre">IndexIterator</span></tt> must be convertible to the
difference type of <tt class="literal"><span class="pre">ElementIterator</span></tt>.</p> difference type of <tt class="literal"><span class="pre">ElementIterator</span></tt>.</p>
</div> </div>
<div class="section" id="permutation-iterator-operations"> <div class="section" id="permutation-iterator-operations">
<h2><a class="toc-backref" href="#id7" name="permutation-iterator-operations"><tt class="literal"><span class="pre">permutation_iterator</span></tt> operations</a></h2> <h2><a class="toc-backref" href="#id8" name="permutation-iterator-operations"><tt class="literal"><span class="pre">permutation_iterator</span></tt> operations</a></h2>
<p>The permutation iterator implements the member functions and operators <p>The permutation iterator implements the member functions and operators
required for the <a class="reference" href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">Random Access Iterator</a> concept. However, the required for the <a class="reference" href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">Random Access Iterator</a> concept. However, the
permutation iterator can only meet the complexity guarantees of the permutation iterator can only meet the complexity guarantees of the
@ -147,7 +147,7 @@ that views the range of elements starting at <tt class="literal"><span class="pr
</div> </div>
</div> </div>
<div class="section" id="example"> <div class="section" id="example">
<h1><a class="toc-backref" href="#id8" name="example">Example</a></h1> <h1><a class="toc-backref" href="#id9" name="example">Example</a></h1>
<pre class="literal-block"> <pre class="literal-block">
using namespace boost; using namespace boost;
int i = 0; int i = 0;
@ -209,12 +209,13 @@ Elements at even indices in the permutation : 9 7
Permutation backwards : 6 7 8 9 Permutation backwards : 6 7 8 9
Iterate backward with stride 2 : 6 8 Iterate backward with stride 2 : 6 8
</pre> </pre>
<p>The source code for this example can be found <a class="reference" href="../example/permutation_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="permutation_iterator.rst">View document source</a>. <a class="reference" href="permutation_iterator.rst">View document source</a>.
Generated on: 2004-01-12 15:20 UTC. Generated on: 2004-01-12 16:08 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

@ -60,3 +60,8 @@ The output is::
Elements at even indices in the permutation : 9 7 Elements at even indices in the permutation : 9 7
Permutation backwards : 6 7 8 9 Permutation backwards : 6 7 8 9
Iterate backward with stride 2 : 6 8 Iterate backward with stride 2 : 6 8
The source code for this example can be found `here`__.
__ ../example/permutation_iterator_example.cpp

View File

@ -47,15 +47,15 @@ invoking <tt class="literal"><span class="pre">operator--()</span></tt> moves th
<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">
<li><a class="reference" href="#reverse-iterator-synopsis" id="id1" name="id1"><tt class="literal"><span class="pre">reverse_iterator</span></tt> synopsis</a></li> <li><a class="reference" href="#reverse-iterator-synopsis" id="id2" name="id2"><tt class="literal"><span class="pre">reverse_iterator</span></tt> synopsis</a></li>
<li><a class="reference" href="#reverse-iterator-requirements" id="id2" name="id2"><tt class="literal"><span class="pre">reverse_iterator</span></tt> requirements</a></li> <li><a class="reference" href="#reverse-iterator-requirements" id="id3" name="id3"><tt class="literal"><span class="pre">reverse_iterator</span></tt> requirements</a></li>
<li><a class="reference" href="#reverse-iterator-models" id="id3" name="id3"><tt class="literal"><span class="pre">reverse_iterator</span></tt> models</a></li> <li><a class="reference" href="#reverse-iterator-models" id="id4" name="id4"><tt class="literal"><span class="pre">reverse_iterator</span></tt> models</a></li>
<li><a class="reference" href="#reverse-iterator-operations" id="id4" name="id4"><tt class="literal"><span class="pre">reverse_iterator</span></tt> operations</a></li> <li><a class="reference" href="#reverse-iterator-operations" id="id5" name="id5"><tt class="literal"><span class="pre">reverse_iterator</span></tt> operations</a></li>
<li><a class="reference" href="#example" id="id5" name="id5">Example</a></li> <li><a class="reference" href="#example" id="id6" name="id6">Example</a></li>
</ul> </ul>
</div> </div>
<div class="section" id="reverse-iterator-synopsis"> <div class="section" id="reverse-iterator-synopsis">
<h1><a class="toc-backref" href="#id1" name="reverse-iterator-synopsis"><tt class="literal"><span class="pre">reverse_iterator</span></tt> synopsis</a></h1> <h1><a class="toc-backref" href="#id2" name="reverse-iterator-synopsis"><tt class="literal"><span class="pre">reverse_iterator</span></tt> synopsis</a></h1>
<pre class="literal-block"> <pre class="literal-block">
template &lt;class Iterator&gt; template &lt;class Iterator&gt;
class reverse_iterator class reverse_iterator
@ -79,19 +79,19 @@ private:
</pre> </pre>
</div> </div>
<div class="section" id="reverse-iterator-requirements"> <div class="section" id="reverse-iterator-requirements">
<h1><a class="toc-backref" href="#id2" 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>The base <tt class="literal"><span class="pre">Iterator</span></tt> must be a model of Bidirectional Traversal
Iterator and Readable Iterator.</p> Iterator 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="#id3" 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 Bidirectional Traversal Iterator and <p><tt class="literal"><span class="pre">reverse_iterator</span></tt> models Bidirectional Traversal Iterator and
Readable Iterator. In addition, <tt class="literal"><span class="pre">reverse_iterator</span></tt> models the same Readable Iterator. In addition, <tt class="literal"><span class="pre">reverse_iterator</span></tt> models the same
standard iterator access concepts that the <tt class="literal"><span class="pre">Iterator</span></tt> standard iterator access concepts that the <tt class="literal"><span class="pre">Iterator</span></tt>
argument models.</p> argument models.</p>
</div> </div>
<div class="section" id="reverse-iterator-operations"> <div class="section" id="reverse-iterator-operations">
<h1><a class="toc-backref" href="#id4" name="reverse-iterator-operations"><tt class="literal"><span class="pre">reverse_iterator</span></tt> operations</a></h1> <h1><a class="toc-backref" href="#id5" name="reverse-iterator-operations"><tt class="literal"><span class="pre">reverse_iterator</span></tt> operations</a></h1>
<p>In addition to the operations required by the concepts modeled by <p>In addition to the operations required by the concepts modeled by
<tt class="literal"><span class="pre">reverse_iterator</span></tt>, <tt class="literal"><span class="pre">reverse_iterator</span></tt> provides the following <tt class="literal"><span class="pre">reverse_iterator</span></tt>, <tt class="literal"><span class="pre">reverse_iterator</span></tt> provides the following
operations.</p> operations.</p>
@ -194,7 +194,7 @@ with a <tt class="literal"><span class="pre">current</span></tt> constructed fro
</table> </table>
</div> </div>
<div class="section" id="example"> <div class="section" id="example">
<h1><a class="toc-backref" href="#id5" name="example">Example</a></h1> <h1><a class="toc-backref" href="#id6" name="example">Example</a></h1>
<p>The following example prints an array of characters in reverse order <p>The following example prints an array of characters in reverse order
using <tt class="literal"><span class="pre">reverse_iterator</span></tt>.</p> using <tt class="literal"><span class="pre">reverse_iterator</span></tt>.</p>
<pre class="literal-block"> <pre class="literal-block">
@ -225,12 +225,13 @@ original sequence of letters: hello world!
sequence in reverse order: !dlrow olleh sequence in reverse order: !dlrow olleh
sequence in double-reversed (normal) order: hello world! sequence in double-reversed (normal) order: hello world!
</pre> </pre>
<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-12 15:45 UTC. Generated on: 2004-01-12 16:04 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

@ -35,3 +35,8 @@ The output is::
original sequence of letters: hello world! original sequence of letters: hello world!
sequence in reverse order: !dlrow olleh sequence in reverse order: !dlrow olleh
sequence in double-reversed (normal) order: hello world! sequence in double-reversed (normal) order: hello world!
The source code for this example can be found `here`__.
__ ../example/reverse_iterator_example.cpp

View File

@ -48,15 +48,15 @@ then returns the result.</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">
<li><a class="reference" href="#transform-iterator-synopsis" id="id1" name="id1"><tt class="literal"><span class="pre">transform_iterator</span></tt> synopsis</a></li> <li><a class="reference" href="#transform-iterator-synopsis" id="id2" name="id2"><tt class="literal"><span class="pre">transform_iterator</span></tt> synopsis</a></li>
<li><a class="reference" href="#transform-iterator-requirements" id="id2" name="id2"><tt class="literal"><span class="pre">transform_iterator</span></tt> requirements</a></li> <li><a class="reference" href="#transform-iterator-requirements" id="id3" name="id3"><tt class="literal"><span class="pre">transform_iterator</span></tt> requirements</a></li>
<li><a class="reference" href="#transform-iterator-models" id="id3" name="id3"><tt class="literal"><span class="pre">transform_iterator</span></tt> models</a></li> <li><a class="reference" href="#transform-iterator-models" id="id4" name="id4"><tt class="literal"><span class="pre">transform_iterator</span></tt> models</a></li>
<li><a class="reference" href="#transform-iterator-operations" id="id4" name="id4"><tt class="literal"><span class="pre">transform_iterator</span></tt> operations</a></li> <li><a class="reference" href="#transform-iterator-operations" id="id5" name="id5"><tt class="literal"><span class="pre">transform_iterator</span></tt> operations</a></li>
<li><a class="reference" href="#example" id="id5" name="id5">Example</a></li> <li><a class="reference" href="#example" id="id6" name="id6">Example</a></li>
</ul> </ul>
</div> </div>
<div class="section" id="transform-iterator-synopsis"> <div class="section" id="transform-iterator-synopsis">
<h1><a class="toc-backref" href="#id1" name="transform-iterator-synopsis"><tt class="literal"><span class="pre">transform_iterator</span></tt> synopsis</a></h1> <h1><a class="toc-backref" href="#id2" name="transform-iterator-synopsis"><tt class="literal"><span class="pre">transform_iterator</span></tt> synopsis</a></h1>
<!-- Version 1.3 of this document was accepted for TR1 --> <!-- Version 1.3 of this document was accepted for TR1 -->
<pre class="literal-block"> <pre class="literal-block">
template &lt;class UnaryFunction, template &lt;class UnaryFunction,
@ -87,7 +87,7 @@ private:
</pre> </pre>
</div> </div>
<div class="section" id="transform-iterator-requirements"> <div class="section" id="transform-iterator-requirements">
<h1><a class="toc-backref" href="#id2" name="transform-iterator-requirements"><tt class="literal"><span class="pre">transform_iterator</span></tt> requirements</a></h1> <h1><a class="toc-backref" href="#id3" name="transform-iterator-requirements"><tt class="literal"><span class="pre">transform_iterator</span></tt> requirements</a></h1>
<p>The type <tt class="literal"><span class="pre">UnaryFunction</span></tt> must be Assignable, Copy Constructible, and <p>The type <tt class="literal"><span class="pre">UnaryFunction</span></tt> must be Assignable, Copy Constructible, and
the expression <tt class="literal"><span class="pre">f(*i)</span></tt> must be valid where <tt class="literal"><span class="pre">f</span></tt> is an object of the expression <tt class="literal"><span class="pre">f(*i)</span></tt> must be valid where <tt class="literal"><span class="pre">f</span></tt> is an object of
type <tt class="literal"><span class="pre">UnaryFunction</span></tt>, <tt class="literal"><span class="pre">i</span></tt> is an object of type <tt class="literal"><span class="pre">Iterator</span></tt>, and type <tt class="literal"><span class="pre">UnaryFunction</span></tt>, <tt class="literal"><span class="pre">i</span></tt> is an object of type <tt class="literal"><span class="pre">Iterator</span></tt>, and
@ -96,7 +96,7 @@ where the type of <tt class="literal"><span class="pre">f(*i)</span></tt> must b
<p>The type <tt class="literal"><span class="pre">Iterator</span></tt> must at least model Readable Iterator.</p> <p>The type <tt class="literal"><span class="pre">Iterator</span></tt> must at least model Readable Iterator.</p>
</div> </div>
<div class="section" id="transform-iterator-models"> <div class="section" id="transform-iterator-models">
<h1><a class="toc-backref" href="#id3" name="transform-iterator-models"><tt class="literal"><span class="pre">transform_iterator</span></tt> models</a></h1> <h1><a class="toc-backref" href="#id4" name="transform-iterator-models"><tt class="literal"><span class="pre">transform_iterator</span></tt> models</a></h1>
<p>The resulting <tt class="literal"><span class="pre">transform_iterator</span></tt> models the most refined of the <p>The resulting <tt class="literal"><span class="pre">transform_iterator</span></tt> models the most refined of the
following options that is also modeled by <tt class="literal"><span class="pre">Iterator</span></tt>.</p> following options that is also modeled by <tt class="literal"><span class="pre">Iterator</span></tt>.</p>
<blockquote> <blockquote>
@ -114,7 +114,7 @@ concept that is modeled by <tt class="literal"><span class="pre">Iterator</span>
The <tt class="literal"><span class="pre">value_type</span></tt> is <tt class="literal"><span class="pre">remove_cv&lt;remove_reference&lt;reference&gt;</span> <span class="pre">&gt;::type</span></tt>.</p> The <tt class="literal"><span class="pre">value_type</span></tt> is <tt class="literal"><span class="pre">remove_cv&lt;remove_reference&lt;reference&gt;</span> <span class="pre">&gt;::type</span></tt>.</p>
</div> </div>
<div class="section" id="transform-iterator-operations"> <div class="section" id="transform-iterator-operations">
<h1><a class="toc-backref" href="#id4" name="transform-iterator-operations"><tt class="literal"><span class="pre">transform_iterator</span></tt> operations</a></h1> <h1><a class="toc-backref" href="#id5" name="transform-iterator-operations"><tt class="literal"><span class="pre">transform_iterator</span></tt> operations</a></h1>
<p>In addition to the operations required by the concepts modeled by <p>In addition to the operations required by the concepts modeled by
<tt class="literal"><span class="pre">transform_iterator</span></tt>, <tt class="literal"><span class="pre">transform_iterator</span></tt> provides the following <tt class="literal"><span class="pre">transform_iterator</span></tt>, <tt class="literal"><span class="pre">transform_iterator</span></tt> provides the following
operations.</p> operations.</p>
@ -234,7 +234,7 @@ default constructed and <tt class="literal"><span class="pre">m_iterator</span><
</table> </table>
</div> </div>
<div class="section" id="example"> <div class="section" id="example">
<h1><a class="toc-backref" href="#id5" name="example">Example</a></h1> <h1><a class="toc-backref" href="#id6" name="example">Example</a></h1>
<p>This is a simple example of using the transform_iterators class to <p>This is a simple example of using the transform_iterators class to
generate iterators that multiply (or add to) the value returned by generate iterators that multiply (or add to) the value returned by
dereferencing the iterator. It would be cooler to use lambda library dereferencing the iterator. It would be cooler to use lambda library
@ -267,12 +267,13 @@ multiplying the array by 2:
adding 4 to each element in the array: adding 4 to each element in the array:
5 6 7 8 9 10 11 12 5 6 7 8 9 10 11 12
</pre> </pre>
<p>The source code for this example can be found <a class="reference" href="../example/transform_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="transform_iterator.rst">View document source</a>. <a class="reference" href="transform_iterator.rst">View document source</a>.
Generated on: 2004-01-12 15:46 UTC. Generated on: 2004-01-12 16:04 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

@ -35,3 +35,8 @@ The output is::
2 4 6 8 10 12 14 16 2 4 6 8 10 12 14 16
adding 4 to each element in the array: adding 4 to each element in the array:
5 6 7 8 9 10 11 12 5 6 7 8 9 10 11 12
The source code for this example can be found `here`__.
__ ../example/transform_iterator_example.cpp

View File

@ -1,7 +1,9 @@
// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify, sell and // (C) Copyright Jeremy Siek 2000-2004.
// distribute this software is granted provided this copyright notice appears // Permission to copy, use, modify, sell and distribute this software
// in all copies. This software is provided "as is" without express or implied // is granted provided this copyright notice appears in all
// warranty, and with no claim as to its suitability for any purpose. // copies. This software is provided "as is" without express or
// implied warranty, and with no claim as to its suitability for any
// purpose.
#include <boost/config.hpp> #include <boost/config.hpp>
#include <vector> #include <vector>