-
+
indirect_iterator adapts an iterator by applying an
extra dereference inside of operator*(). For example, this
iterator adaptor makes it possible to view a container of pointers
@@ -1262,7 +1262,7 @@ auxiliary traits, pointee and
provide support for underlying iterators whose value_type is
not an iterator.
-
+
@@ -1306,7 +1306,7 @@ else
-
+
@@ -1341,7 +1341,7 @@ else
-
+
template <
class Iterator
@@ -1381,9 +1381,9 @@ private:
Iterator m_iterator; // exposition
};
-
The member types of indirect_iterator are defined according to the
-following pseudo-code. We use the abbreviation
-V=iterator_traits<Iterator>::value_type.:
+
The member types of indirect_iterator are defined according to
+the following pseudo-code, where V is
+iterator_traits<Iterator>::value_type
if (Value is use_default) then
typedef remove_const<pointee<V>::type>::type value_type;
@@ -1407,14 +1407,19 @@ if (Difference is use_default)
typedef iterator_traits<Iterator>::difference_type difference_type;
else
typedef Difference difference_type;
+
+if (CategoryOrTraversal is use_default)
+ typedef iterator-category(
+ iterator_traversal<Iterator>::type,``reference``,``value_type``
+ ) iterator_category;
+else
+ typedef iterator-category(
+ CategoryOrTraversal,``reference``,``value_type``
+ ) iterator_category;
-
The iterator_category member is facade_iterator_category(C,
-value_type, reference) where if CategoryOrTraversal is
-use_default, C is iterator_traversal<Iterator>::type and
-otherwise C is CategoryOrTraversal.
-
+
The expression *v, where v is an object of
iterator_traits<Iterator>::value_type, shall be valid
expression and convertible to reference. Iterator shall
@@ -1428,7 +1433,7 @@ parameter is not use_default,
deducing the default for the value_type member.]
-
+
In addition to the concepts indicated by iterator_category
and by iterator_traversal<indirect_iterator>::type, a
specialization of indirect_iterator models the following
@@ -1445,11 +1450,11 @@ expression (where t is an obje
indirect_iterator<X,V1,C1,R1,D1> is interoperable with
-indirect_iterator<Y,V2,C2,R2,D2> if and only if iterator X is
-interoperable with iterator Y.
+
indirect_iterator<Y,V2,C2,R2,D2> if and only if
X is
+interoperable with
Y.
-
+
In addition to the operations required by the concepts described
above, specializations of indirect_iterator provide the
following operations.
@@ -1541,11 +1546,11 @@ indirect_iterator(
-
+
The reverse iterator adaptor iterates through the adapted iterator
range in the opposite direction.
-
+
template <class Iterator>
class reverse_iterator
@@ -1582,11 +1587,11 @@ Lvalue Iterator, then iterator_categoryinput_iterator_tag.
-
+
Iterator must be a model of Bidirectional Traversal Iterator.
-
+
A specialization of reverse_iterator models the same standard
traversal and access iterator concepts modeled by its Iterator
argument. In addition, it models the old iterator concepts
@@ -1624,7 +1629,7 @@ Random Access Traversal Iterator
if and only if iterator X is interoperable with iterator Y.
-
+
In addition to the operations required by the concepts modeled by
reverse_iterator, reverse_iterator provides the following
operations.
@@ -1714,12 +1719,12 @@ return *--tmp;
-
+
The filter iterator adaptor creates a view of an iterator range in
which some elements of the range are skipped. A predicate function
object controls which elements are skipped. When the predicate is
@@ -1933,7 +1938,7 @@ underlying range. A filter iterator is therefore constructed with pair
of iterators indicating the range of elements in the unfiltered
sequence to be traversed.
-
+
@@ -1974,7 +1979,7 @@ Iterator then
iterator_categorystd::input_iterator_tag.
-
+
The Predicate argument must be Assignable, Copy Constructible, and
the expression p(x) must be valid where p is an object of type
Predicate, x is an object of type
@@ -1985,7 +1990,7 @@ Iterator and Single Pass Iterator or it shall meet the requirements of
Input Iterator.
-
+
The concepts that filter_iterator models are dependent on which
concepts the Iterator argument models, as specified in the
following tables.
@@ -2056,7 +2061,7 @@ following tables.
if and only if iterator
X is interoperable with iterator
Y.
-
+
In addition to those operations required by the concepts that
filter_iterator models, filter_iterator provides the following
operations.
@@ -2167,12 +2172,12 @@ or
m_pred(*m_iter)
-
+
counting_iterator adapts an object by adding an operator* that
returns the current value of the object. All other iterator operations
are forwarded to the adapted object.
-
+
template <
class Incrementable
@@ -2199,24 +2204,28 @@ class counting_iterator
Incrementable m_inc; // exposition
};
-
If the Difference argument is use_default then the
-difference_type member is an unspecified signed integral
+
If the Difference argument is use_default then
+difference_type is an unspecified signed integral
type. Otherwise difference_type is Difference.
-
If CategoryOrTraversal is not use_default then the member
-iterator_category is CategoryOrTraversal. Otherwise, if
-numeric_limits<Incrementable>::is_specialized, then
-iterator_category is a
-facade_iterator_category(random_access_traversal_tag, Incrementable, const Incrementable&).
-Otherwise, iterator_category is
-facade_iterator_category(iterator_traversal<Incrementable>::type, Incrementable, const Incrementable&).
-
-- [Note: implementers are encouraged to provide an implementation of
-- operator- and the default difference_type that avoids overflows in
-the cases when the Incrementable type is a numeric type.]
-
+
iterator_category is determined according to the following
+algorithm:
+
+if (CategoryOrTraversal is not use_default)
+ return CategoryOrTraversal
+else if (numeric_limits<Incrementable>::is_specialized)
+ return iterator-category(
+ random_access_traversal_tag, Incrementable, const Incrementable&)
+else
+ return iterator-category(
+ iterator_traversal<Incrementable>::type,
+ Incrementable, const Incrementable&)
+
+
[Note: implementers are encouraged to provide an implementation
+of operator- and a default difference_type that avoid
+overflows when Incrementable is a numeric type.]
-
+
The Incrementable argument shall be Copy Constructible and Assignable.
If iterator_category is convertible to forward_iterator_tag
or forward_traversal_tag, the following must be well-formed:
@@ -2242,7 +2251,7 @@ i < j;
-
+
Specializations of counting_iterator model Readable Lvalue
Iterator. In addition, they model the concepts corresponding to the
iterator tags to which their iterator_category is convertible.
@@ -2258,7 +2267,7 @@ concepts modeled by Incrementable
interoperable with iterator Y.
-
+
In addition to the operations required by the concepts modeled by
counting_iterator, counting_iterator provides the following
operations.
@@ -2334,7 +2343,7 @@ operations.
-
+
The function output iterator adaptor makes it easier to create custom
output iterators. The adaptor takes a unary function and creates a
model of Output Iterator. Each item assigned to the output iterator is
@@ -2343,7 +2352,7 @@ iterator is that creating a conforming output iterator is non-trivial,
particularly because the proper implementation usually requires a
proxy object.
-
+
template <class UnaryFunction>
class function_output_iterator {
@@ -2365,16 +2374,16 @@ private:
-
+
UnaryFunction must be Assignable and Copy Constructible.
-
+
function_output_iterator is a model of the Writable and
Incrementable Iterator concepts.
-
+
explicit function_output_iterator(const UnaryFunction& f = UnaryFunction());
diff --git a/doc/facade_iterator_category.rst b/doc/facade_iterator_category.rst
index ea2e538..6b60d85 100755
--- a/doc/facade_iterator_category.rst
+++ b/doc/facade_iterator_category.rst
@@ -1,3 +1,6 @@
+.. |iterator-category| replace:: *iterator-category*
+.. _iterator-category:
+
.. parsed-literal::
*iterator-category*\ (C,R,V) :=
diff --git a/doc/indirect_iterator.html b/doc/indirect_iterator.html
index 4cc32e8..64e48ea 100644
--- a/doc/indirect_iterator.html
+++ b/doc/indirect_iterator.html
@@ -98,9 +98,9 @@ private:
Iterator m_iterator; // exposition
};
-The member types of indirect_iterator are defined according to the
-following pseudo-code. We use the abbreviation
-V=iterator_traits<Iterator>::value_type.:
+The member types of indirect_iterator are defined according to
+the following pseudo-code, where V is
+iterator_traits<Iterator>::value_type
if (Value is use_default) then
typedef remove_const<pointee<V>::type>::type value_type;
@@ -124,11 +124,16 @@ if (Difference is use_default)
typedef iterator_traits<Iterator>::difference_type difference_type;
else
typedef Difference difference_type;
+
+if (CategoryOrTraversal is use_default)
+ typedef iterator-category(
+ iterator_traversal<Iterator>::type,``reference``,``value_type``
+ ) iterator_category;
+else
+ typedef iterator-category(
+ CategoryOrTraversal,``reference``,``value_type``
+ ) iterator_category;
-The iterator_category member is facade_iterator_category(C,
-value_type, reference) where if CategoryOrTraversal is
-use_default, C is iterator_traversal<Iterator>::type and
-otherwise C is CategoryOrTraversal.
@@ -162,8 +167,8 @@ expression (where
t is an obje
indirect_iterator<X,V1,C1,R1,D1> is interoperable with
-indirect_iterator<Y,V2,C2,R2,D2> if and only if iterator X is
-interoperable with iterator Y.
+
indirect_iterator<Y,V2,C2,R2,D2> if and only if
X is
+interoperable with
Y.
diff --git a/doc/indirect_iterator.rst b/doc/indirect_iterator.rst
index b23afa8..ad3778d 100644
--- a/doc/indirect_iterator.rst
+++ b/doc/indirect_iterator.rst
@@ -25,3 +25,6 @@
.. include:: indirect_iterator_ref.rst
.. include:: indirect_iterator_eg.rst
+
+.. _iterator-category: iterator_facade.html#iterator-category
+.. |iterator-category| replace:: *iterator-category*
diff --git a/doc/indirect_iterator_ref.rst b/doc/indirect_iterator_ref.rst
index 22a1c35..a08aedf 100644
--- a/doc/indirect_iterator_ref.rst
+++ b/doc/indirect_iterator_ref.rst
@@ -39,9 +39,11 @@
};
-The member types of ``indirect_iterator`` are defined according to the
-following pseudo-code. We use the abbreviation
-``V=iterator_traits
::value_type``.::
+The member types of ``indirect_iterator`` are defined according to
+the following pseudo-code, where ``V`` is
+``iterator_traits::value_type``
+
+.. parsed-literal::
if (Value is use_default) then
typedef remove_const::type>::type value_type;
@@ -57,21 +59,23 @@ following pseudo-code. We use the abbreviation
typedef Reference reference;
if (Value is use_default) then
- typedef pointee::type* pointer;
+ typedef pointee::type\* pointer;
else
- typedef Value* pointer;
+ typedef Value\* pointer;
if (Difference is use_default)
typedef iterator_traits::difference_type difference_type;
else
typedef Difference difference_type;
-
-
-The ``iterator_category`` member is ``facade_iterator_category(C,
-value_type, reference)`` where if ``CategoryOrTraversal`` is
-``use_default``, ``C`` is ``iterator_traversal::type`` and
-otherwise ``C`` is ``CategoryOrTraversal``.
+ if (CategoryOrTraversal is use_default)
+ typedef |iterator-category|_\ (
+ iterator_traversal::type,``reference``,``value_type``
+ ) iterator_category;
+ else
+ typedef |iterator-category|_\ (
+ CategoryOrTraversal,``reference``,``value_type``
+ ) iterator_category;
``indirect_iterator`` requirements
@@ -109,8 +113,8 @@ concepts, Where ``v`` is an object of
* Lvalue Iterator if ``reference`` is a reference type.
``indirect_iterator`` is interoperable with
-``indirect_iterator`` if and only if iterator ``X`` is
-interoperable with iterator ``Y``.
+``indirect_iterator`` if and only if ``X`` is
+interoperable with ``Y``.
``indirect_iterator`` operations
diff --git a/doc/iterator_facade.html b/doc/iterator_facade.html
index 3ef1219..6a2bbe9 100644
--- a/doc/iterator_facade.html
+++ b/doc/iterator_facade.html
@@ -45,43 +45,43 @@ and associated types, to be supplied by a derived iterator class.
-
+
@@ -662,7 +662,7 @@ example of a linked list of polymorphic objects. This example was
inspired by a
posting by Keith Macdonald on the
Boost-Users
mailing list.
-
+
Say we've written a polymorphic linked list node base class:
# include <iostream>
@@ -724,7 +724,7 @@ inline std::ostream& operator<<(std::ostream& s, node_base const&a
lists.
-
+
We will construct a node_iterator class using inheritance from
iterator_facade to implement most of the iterator's operations.
@@ -738,24 +738,24 @@ class node_iterator
};
-
+
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.
-
+
Because iterator_facade is meant to be used with the CRTP
-[Cop95] the first parameter is the iterator class name itself,
+[Cop95] the first parameter is the iterator class name itself,
node_iterator.
-
+
The Value parameter determines the node_iterator's
value_type. In this case, we are iterating over node_base
objects, so Value will be node_base.
-
+
Now we have to determine which iterator traversal concept our
node_iterator is going to model. Singly-linked lists only have
forward links, so our iterator can't can't be a bidirectional
@@ -763,19 +763,19 @@ traversal iterator. Our iterator should be able to make multiple
passes over the same linked list (unlike, say, an
istream_iterator which consumes the stream it traverses), so it
must be a forward traversal iterator. Therefore, we'll pass
-boost::forward_traversal_tag in this position .
+
boost::forward_traversal_tag in this position .
-
-
+
+
The Reference argument becomes the type returned by
node_iterator's dereference operation, and will also be the
same as std::iterator_traits<node_iterator>::reference. The
@@ -784,7 +784,7 @@ library's default for this parameter is Va
type, we can omit this argument, or pass use_default.
-
+
The Difference argument determines how the distance between
two node_iterators will be measured and will also be the
same as std::iterator_traits<node_iterator>::difference_type.
@@ -811,14 +811,14 @@ class node_iterator
-
+
Next we need to decide how to represent the iterator's position.
This representation will take the form of data members, so we'll
also need to write constructors to initialize them. The
node_iterator's position is quite naturally represented using
a pointer to a node_base. We'll need a constructor to build an
iterator from a node_base*, and a default constructor to
-satisfy the forward traversal iterator requirements .
+satisfy the forward traversal iterator requirements .
Our node_iterator then becomes:
# include "node.hpp"
@@ -848,7 +848,7 @@ class node_iterator