From 7fc54ec2d8e65f52d2855bb07fcd89ca15529026 Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Mon, 12 Jan 2004 04:36:23 +0000 Subject: [PATCH] a couple small edits to the iterator facade tutorial [SVN r21620] --- doc/function_output_iterator.html | 4 +- doc/indirect_iterator.html | 4 +- doc/iterator_facade.html | 260 +++--------------------------- doc/iterator_facade_tutorial.rst | 28 +++- 4 files changed, 47 insertions(+), 249 deletions(-) diff --git a/doc/function_output_iterator.html b/doc/function_output_iterator.html index 9349fb0..ec724b3 100644 --- a/doc/function_output_iterator.html +++ b/doc/function_output_iterator.html @@ -7,7 +7,7 @@ Function Output Iterator - + @@ -27,7 +27,7 @@ Lab, University of Hanover Institute for Transport Railway Operation and Construction Date: -2003-09-14 +2004-01-12 Copyright: Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All rights reserved diff --git a/doc/indirect_iterator.html b/doc/indirect_iterator.html index cf57bd8..cd2362c 100644 --- a/doc/indirect_iterator.html +++ b/doc/indirect_iterator.html @@ -7,7 +7,7 @@ Indirect Iterator - + @@ -27,7 +27,7 @@ Lab, University of Hanover Institute for Transport Railway Operation and Construction Date: -2003-09-14 +2004-01-12 Copyright: Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All rights reserved diff --git a/doc/iterator_facade.html b/doc/iterator_facade.html index d256715..de2212e 100644 --- a/doc/iterator_facade.html +++ b/doc/iterator_facade.html @@ -3,240 +3,13 @@ - + Iterator Facade - +
@@ -284,7 +57,7 @@ and associated types, to be supplied by a derived iterator class.
  • Introduction
  • The Problem
  • A Basic Iterator Using iterator_facade
  • A Basic Iterator Using iterator_facade

    -
    -

    Template Parameters

    -

    The first step in building a concrete iterator with iterator_facade -is to decide what its template parameters will be.

    +

    We will construct a node_iterator class using inheritance from +iterator_facade to implement most of the iterator's operations.

    +
    +# include "node.hpp"
    +# include <boost/iterator/iterator_facade.hpp>
    +
    +class node_iterator
    +  : public boost::iterator_facade<...>
    +{
    +   ...
    +};
    +
    +
    +

    Template Arguments for iterator_facade

    +

    iterator_facade has several template parameters, so we must decide +what types to use for the arguments. The parameters are Derived, +Value, CategoryOrTraversal, Reference, and Difference.

    Derived

    Because iterator_facade is meant to be used with the CRTP @@ -1356,11 +1142,5 @@ return tmp -= n;

    - - diff --git a/doc/iterator_facade_tutorial.rst b/doc/iterator_facade_tutorial.rst index 553b7cb..869e5d5 100755 --- a/doc/iterator_facade_tutorial.rst +++ b/doc/iterator_facade_tutorial.rst @@ -75,11 +75,29 @@ lists. A Basic Iterator Using ``iterator_facade`` ------------------------------------------ -Template Parameters -................... +We will construct a ``node_iterator`` class using inheritance from +``iterator_facade`` to implement most of the iterator's operations. + +:: + + # include "node.hpp" + # include + + class node_iterator + : public boost::iterator_facade<...> + { + ... + }; + + + +Template Arguments for ``iterator_facade`` +.......................................... + +``iterator_facade`` has several template parameters, so we must decide +what types to use for the arguments. The parameters are ``Derived``, +``Value``, ``CategoryOrTraversal``, ``Reference``, and ``Difference``. -The first step in building a concrete iterator with iterator_facade -is to decide what its template parameters will be. ``Derived`` ''''''''''' @@ -109,7 +127,7 @@ must be a `forward traversal iterator`_. Therefore, we'll pass ``boost::forward_traversal_tag`` in this position [#category]_. .. [#category] ``iterator_facade`` also supports old-style category - tags, so we could've passed ``std::forward_iterator_tag`` here; + tags, so we could have passed ``std::forward_iterator_tag`` here; either way, the resulting iterator's ``iterator_category`` will end up being ``std::forward_iterator_tag``.