From bcc0e8043970ed3e9d702395a707745310328ebf Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Mon, 12 Jan 2004 20:18:41 +0000 Subject: [PATCH] improved the models section of transform iterator to discuss old iterator categories [SVN r21643] --- doc/facade-and-adaptor.html | 56 ++++++++++++++++++++++++++++------ doc/transform_iterator.html | 56 ++++++++++++++++++++++++++++------ doc/transform_iterator_ref.rst | 45 +++++++++++++++++++++------ 3 files changed, 130 insertions(+), 27 deletions(-) diff --git a/doc/facade-and-adaptor.html b/doc/facade-and-adaptor.html index 7d05938..fcf910f 100755 --- a/doc/facade-and-adaptor.html +++ b/doc/facade-and-adaptor.html @@ -1668,6 +1668,12 @@ template <class UnaryFunction, class transform_iterator { public: + typedef /* see below */ value_type; + typedef /* see below */ reference; + typedef /* see below */ pointer; + typedef iterator_traits<Iterator>::difference_type difference_type; + typedef /* see below */ iterator_category; + transform_iterator(); transform_iterator(Iterator const& x, UnaryFunction f); @@ -1687,6 +1693,12 @@ private: UnaryFunction m_f; // exposition only }; +

The reference type of transform_iterator is +result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type. +The value_type is remove_cv<remove_reference<reference> >::type. +The iterator_category member is a type convertible to the tags +corresponding to each standard concept modeled by +transform_iterator, as described in the models section.

transform_iterator requirements

@@ -1695,7 +1707,7 @@ the expression f(*i) must be v type UnaryFunction, i is an object of type Iterator, and where the type of f(*i) must be result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type.

-

The type Iterator must at least model Readable Iterator.

+

The argument Iterator shall model Readable Iterator.

transform_iterator models

@@ -1703,17 +1715,43 @@ where the type of f(*i) must b following options that is also modeled by Iterator.

    -
  • Writable Lvalue Iterator if result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type is a non-const reference.
  • -
  • Readable Lvalue Iterator if result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type is a const -reference.
  • +
  • Writable Lvalue Iterator if transform_iterator::reference is a non-const reference.
  • +
  • Readable Lvalue Iterator if transform_iterator::reference is a const reference.
  • Readable Iterator otherwise.

The transform_iterator models the most refined standard traversal -concept that is modeled by Iterator.

-

The reference type of transform_iterator is -result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type. -The value_type is remove_cv<remove_reference<reference> >::type.

+concept that is modeled by the Iterator argument.

+

If transform_iterator is a model of Readable Lvalue Iterator then +it models the following original iterator concepts depending on what +the Iterator argument models.

+ ++++ + + + + + + + + + + + + + + + + + + + +
If Iterator modelsthen filter_iterator models
Single Pass IteratorInput Iterator
Forward Traversal IteratorForward Iterator
Bidirectional Traversal IteratorBidirectional Iterator
Random Access Traversal IteratorRandom Access Iterator
+

If transform_iterator models Writable Lvalue Iterator then it is a +mutable iterator (as defined in the old iterator requirements).

transform_iterator operations

@@ -2293,7 +2331,7 @@ LocalWords: OtherIncrementable Coplien --> diff --git a/doc/transform_iterator.html b/doc/transform_iterator.html index 1da8927..1b3afd8 100644 --- a/doc/transform_iterator.html +++ b/doc/transform_iterator.html @@ -64,6 +64,12 @@ template <class UnaryFunction, class transform_iterator { public: + typedef /* see below */ value_type; + typedef /* see below */ reference; + typedef /* see below */ pointer; + typedef iterator_traits<Iterator>::difference_type difference_type; + typedef /* see below */ iterator_category; + transform_iterator(); transform_iterator(Iterator const& x, UnaryFunction f); @@ -83,6 +89,12 @@ private: UnaryFunction m_f; // exposition only }; +

The reference type of transform_iterator is +result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type. +The value_type is remove_cv<remove_reference<reference> >::type. +The iterator_category member is a type convertible to the tags +corresponding to each standard concept modeled by +transform_iterator, as described in the models section.

transform_iterator requirements

@@ -91,7 +103,7 @@ the expression f(*i) must be v type UnaryFunction, i is an object of type Iterator, and where the type of f(*i) must be result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type.

-

The type Iterator must at least model Readable Iterator.

+

The argument Iterator shall model Readable Iterator.

transform_iterator models

@@ -99,17 +111,43 @@ where the type of f(*i) must b following options that is also modeled by Iterator.

    -
  • Writable Lvalue Iterator if result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type is a non-const reference.
  • -
  • Readable Lvalue Iterator if result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type is a const -reference.
  • +
  • Writable Lvalue Iterator if transform_iterator::reference is a non-const reference.
  • +
  • Readable Lvalue Iterator if transform_iterator::reference is a const reference.
  • Readable Iterator otherwise.

The transform_iterator models the most refined standard traversal -concept that is modeled by Iterator.

-

The reference type of transform_iterator is -result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type. -The value_type is remove_cv<remove_reference<reference> >::type.

+concept that is modeled by the Iterator argument.

+

If transform_iterator is a model of Readable Lvalue Iterator then +it models the following original iterator concepts depending on what +the Iterator argument models.

+ ++++ + + + + + + + + + + + + + + + + + + + +
If Iterator modelsthen filter_iterator models
Single Pass IteratorInput Iterator
Forward Traversal IteratorForward Iterator
Bidirectional Traversal IteratorBidirectional Iterator
Random Access Traversal IteratorRandom Access Iterator
+

If transform_iterator models Writable Lvalue Iterator then it is a +mutable iterator (as defined in the old iterator requirements).

transform_iterator operations

@@ -271,7 +309,7 @@ adding 4 to each element in the array: diff --git a/doc/transform_iterator_ref.rst b/doc/transform_iterator_ref.rst index 2ba9f97..7a0d89d 100644 --- a/doc/transform_iterator_ref.rst +++ b/doc/transform_iterator_ref.rst @@ -9,6 +9,12 @@ class transform_iterator { public: + typedef /* see below */ value_type; + typedef /* see below */ reference; + typedef /* see below */ pointer; + typedef iterator_traits::difference_type difference_type; + typedef /* see below */ iterator_category; + transform_iterator(); transform_iterator(Iterator const& x, UnaryFunction f); @@ -29,6 +35,14 @@ }; +The ``reference`` type of ``transform_iterator`` is +``result_of::reference)>::type``. +The ``value_type`` is ``remove_cv >::type``. +The ``iterator_category`` member is a type convertible to the tags +corresponding to each standard concept modeled by +``transform_iterator``, as described in the models section. + + ``transform_iterator`` requirements ................................... @@ -38,7 +52,7 @@ type ``UnaryFunction``, ``i`` is an object of type ``Iterator``, and where the type of ``f(*i)`` must be ``result_of::reference)>::type``. -The type ``Iterator`` must at least model Readable Iterator. +The argument ``Iterator`` shall model Readable Iterator. ``transform_iterator`` models @@ -47,20 +61,33 @@ The type ``Iterator`` must at least model Readable Iterator. The resulting ``transform_iterator`` models the most refined of the following options that is also modeled by ``Iterator``. - * Writable Lvalue Iterator if ``result_of::reference)>::type`` is a non-const reference. + * Writable Lvalue Iterator if ``transform_iterator::reference`` is a non-const reference. - * Readable Lvalue Iterator if ``result_of::reference)>::type`` is a const - reference. + * Readable Lvalue Iterator if ``transform_iterator::reference`` is a const reference. * Readable Iterator otherwise. - The ``transform_iterator`` models the most refined standard traversal -concept that is modeled by ``Iterator``. +concept that is modeled by the ``Iterator`` argument. -The ``reference`` type of ``transform_iterator`` is -``result_of::reference)>::type``. -The ``value_type`` is ``remove_cv >::type``. +If ``transform_iterator`` is a model of Readable Lvalue Iterator then +it models the following original iterator concepts depending on what +the ``Iterator`` argument models. + ++-----------------------------------+---------------------------------+ +| If ``Iterator`` models | then ``filter_iterator`` models | ++===================================+=================================+ +| Single Pass Iterator | Input Iterator | ++-----------------------------------+---------------------------------+ +| Forward Traversal Iterator | Forward Iterator | ++-----------------------------------+---------------------------------+ +| Bidirectional Traversal Iterator | Bidirectional Iterator | ++-----------------------------------+---------------------------------+ +| Random Access Traversal Iterator | Random Access Iterator | ++-----------------------------------+---------------------------------+ + +If ``transform_iterator`` models Writable Lvalue Iterator then it is a +mutable iterator (as defined in the old iterator requirements). ``transform_iterator`` operations