From 309f7415883619ff8acc6d26eb8407233d1b10c0 Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Sun, 18 Jan 2004 20:44:10 +0000 Subject: [PATCH] blah [SVN r21818] --- doc/facade-and-adaptor.html | 15 ++-- doc/indirect_iterator_ref.rst | 4 +- doc/iter-issue-list.rst | 156 +++++++++++++++++++++++++++++----- 3 files changed, 143 insertions(+), 32 deletions(-) diff --git a/doc/facade-and-adaptor.html b/doc/facade-and-adaptor.html index b55fbc5..bb8d52e 100755 --- a/doc/facade-and-adaptor.html +++ b/doc/facade-and-adaptor.html @@ -6,8 +6,8 @@ Iterator Facade and Adaptor - - + + @@ -20,13 +20,12 @@ Author: David Abrahams, Jeremy Siek, Thomas Witt Contact: -dave@boost-consulting.com, jsiek@osl.iu.edu, witt@acm.org +dave@boost-consulting.com, jsiek@osl.iu.edu, witt@styleadvisor.com Organization: Boost Consulting, Indiana University Open Systems -Lab, University of Hanover Institute for Transport -Railway Operation and Construction +Lab, Zephyr Associates, Inc. Date: -2004-01-13 +2004-01-18 Number:This is a revised version of N1530=03-0113, which was accepted for Technical Report 1 by the C++ standard committee's library working group. @@ -743,7 +742,7 @@ traversal tags would add no information]

The enable_if_interoperable template used above is for exposition -purposes. The member operators should be only be in an overload set +purposes. The member operators should only be in an overload set provided the derived types Dr1 and Dr2 are interoperable, meaning that at least one of the types is convertible to the other. The enable_if_interoperable approach uses SFINAE to take the operators @@ -1121,7 +1120,7 @@ operator -(iterator_facade<Dr1,V1,TC1,R1,D1> const& lhs, Returns:if is_convertible<Dr2,Dr1>::value, then -lhs.distance_to(rhs). Otherwise, --rhs.distance_to(lhs). +rhs.distance_to(lhs). diff --git a/doc/indirect_iterator_ref.rst b/doc/indirect_iterator_ref.rst index a08aedf..8b844bc 100644 --- a/doc/indirect_iterator_ref.rst +++ b/doc/indirect_iterator_ref.rst @@ -69,11 +69,11 @@ the following pseudo-code, where ``V`` is typedef Difference difference_type; if (CategoryOrTraversal is use_default) - typedef |iterator-category|_\ ( + typedef *iterator-category* ( iterator_traversal::type,``reference``,``value_type`` ) iterator_category; else - typedef |iterator-category|_\ ( + typedef *iterator-category* ( CategoryOrTraversal,``reference``,``value_type`` ) iterator_category; diff --git a/doc/iter-issue-list.rst b/doc/iter-issue-list.rst index 5724721..fa2e195 100644 --- a/doc/iter-issue-list.rst +++ b/doc/iter-issue-list.rst @@ -374,6 +374,49 @@ readability seems to introduce needless complexity. else return null_category_tag; + + In [lib.iterator.special.adaptors]: + + Change:: + + template < + class Iterator + , class Value = use_default + , unsigned Access = use_default_access + , class Traversal = use_default + , class Reference = use_default + , class Difference = use_default + > + class indirect_iterator + + to:: + + template < + class Iterator + , class Value = use_default + , class CategoryOrTraversal = use_default + , class Reference = use_default + , class Difference = use_default + > + class indirect_iterator + + Change:: + + template < + class Iterator2, class Value2, unsigned Access2, class Traversal2 + , class Reference2, class Difference2 + > + indirect_iterator( + + to:: + + template < + class Iterator2, class Value2, class Category2 + , class Reference2, class Difference2 + > + indirect_iterator( + + :Rationale: 1. There are two reasons for removing ``is_writable`` @@ -705,29 +748,20 @@ Is that what's meant here? constructor like this: the constructor returns "a copy" of the argument without saying what a copy is.) -:Proposed resolution: Change the specification to +:Proposed resolution: -:: + Change: - template < - class Iterator2, class Value2, unsigned Access, class Traversal - , class Reference2, class Difference2 - > - indirect_iterator( - indirect_iterator< - Iterator2, Value2, Access, Traversal, Reference2, Difference2 - > const& y - , typename enable_if_convertible::type* = 0 // exposition - ); + :Returns: An instance of ``indirect_iterator`` that is a copy of ``y``. -:Requires: ``Iterator2`` is implicitly convertible to ``Iterator``. -:Returns: An instance of ``indirect_iterator`` whose - ``m_iterator`` subobject is constructed from ``y.base()``. + to: + + :Returns: An instance of ``indirect_iterator`` whose + ``m_iterator`` subobject is constructed from ``y.base()``. :Rationale: Inheritance from iterator_adaptor has been removed, so we - instead give the semantics in terms of the (exposition only) member - ``m_iterator``. + instead give the semantics in terms of the member ``m_iterator``. 9.30 transform_iterator argument irregularity @@ -934,6 +968,84 @@ provide rather than how they're implemented. In [lib.iterator.special.adaptors] + Change:: + + class indirect_iterator + : public iterator_adaptor + { + friend class iterator_core_access; + + to:: + + class indirect_iterator + { + public: + typedef /* see below */ value_type; + typedef /* see below */ reference; + typedef /* see below */ pointer; + typedef /* see below */ difference_type; + typedef /* see below */ iterator_category; + + Change:: + + private: // as-if specification + typename indirect_iterator::reference dereference() const + { + return **this->base(); + } + + to:: + + Iterator base() const; + reference operator*() const; + indirect_iterator& operator++(); + indirect_iterator& operator--(); + private: + Iterator m_iterator; // exposition + + + After the synopsis add: + + 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; + else + typedef remove_const::type value_type; + + if (Reference is use_default) then + if (Value is use_default) then + typedef indirect_reference::type reference; + else + typedef Value& reference; + else + typedef Reference reference; + + if (Value is use_default) then + typedef pointee::type\* pointer; + else + typedef Value\* pointer; + + if (Difference is use_default) + typedef iterator_traits::difference_type difference_type; + else + typedef Difference difference_type; + + 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; + + + Change:: @@ -954,7 +1066,7 @@ provide rather than how they're implemented. typedef /* see below */ iterator_category; - Add:: + After ``UnaryFunction functor() const;`` add:: Iterator base() const; reference operator*() const; @@ -976,7 +1088,7 @@ provide rather than how they're implemented. }; - Add: + After the synopsis, add: If ``Iterator`` models Readable Lvalue Iterator and if ``Iterator`` models Random Access Traversal Iterator, then ``iterator_category`` is @@ -993,7 +1105,7 @@ provide rather than how they're implemented. 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``. + following that is also modeled by ``Iterator``. * Writable Lvalue Iterator if ``result_of::reference)>::type`` is a non-const reference. @@ -1015,7 +1127,7 @@ provide rather than how they're implemented. The argument ``Iterator`` shall model Readable Iterator. - Add a new models section: + Add a models section after the requirements section with the following contents: The resulting ``transform_iterator`` models the most refined of the following options that is also modeled by ``Iterator``. @@ -1059,7 +1171,7 @@ provide rather than how they're implemented. :Returns: ``m_f(transform_iterator::dereference());`` - Add:: + After the entry for ``functor()``, add:: ``Iterator base() const;``