From efecfd17b996c8b92caa0f0046ca60ab812f6cb7 Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Fri, 8 Jun 2001 15:36:30 +0000 Subject: [PATCH] updated to match working group paper [SVN r10294] --- .../libs/iterator/iterator_concepts.fig | 28 +- .../libs/iterator/iterator_concepts.gif | Bin 2994 -> 2910 bytes .../libs/iterator/iterator_concepts.htm | 653 ++++++++++-------- 3 files changed, 369 insertions(+), 312 deletions(-) diff --git a/development/libs/iterator/iterator_concepts.fig b/development/libs/iterator/iterator_concepts.fig index 3c51b23..0723053 100644 --- a/development/libs/iterator/iterator_concepts.fig +++ b/development/libs/iterator/iterator_concepts.fig @@ -7,20 +7,16 @@ Letter Single -2 1200 2 -6 825 1575 3825 4500 +6 750 2100 3750 4125 2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 1 0 2 1 1 1.00 60.00 120.00 - 1725 2400 1725 1800 + 1650 3825 1650 3225 2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 1 0 2 1 1 1.00 60.00 120.00 - 1725 4200 1725 3600 -2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 1725 3300 1725 2700 -4 0 0 100 0 19 18 0.0000 4 255 2370 825 1800 SinglePassIterator\001 -4 0 0 100 0 19 18 0.0000 4 195 1995 825 2700 ForwardIterator\001 -4 0 0 100 0 19 18 0.0000 4 195 2565 825 3600 BidirectionalIterator\001 -4 0 0 100 0 19 18 0.0000 4 195 2955 825 4500 RandomAccessIterator\001 + 1650 2925 1650 2325 +4 0 0 100 0 19 18 0.0000 4 210 1995 750 2325 ForwardIterator\001 +4 0 0 100 0 19 18 0.0000 4 210 2580 750 3225 BidirectionalIterator\001 +4 0 0 100 0 19 18 0.0000 4 210 2940 750 4125 RandomAccessIterator\001 -6 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 1 1 1.00 60.00 120.00 @@ -31,7 +27,11 @@ Single 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 1 1 1.00 60.00 120.00 6900 3000 7500 2400 -4 0 0 100 0 19 18 0.0000 4 195 1995 6600 2400 WritableIterator\001 -4 0 0 100 0 19 18 0.0000 4 195 2130 3900 2400 ReadableIterator\001 -4 0 0 50 0 19 18 0.0000 4 195 2805 5700 3300 MutableLvalueIterator\001 -4 0 0 50 0 19 18 0.0000 4 195 2955 3900 3900 ConstantLvalueIterator\001 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 6900 3000 9075 2475 +4 0 0 100 0 19 18 0.0000 4 210 2040 6600 2400 WritableIterator\001 +4 0 0 100 0 19 18 0.0000 4 210 2145 3900 2400 ReadableIterator\001 +4 0 0 50 0 19 18 0.0000 4 210 2835 5700 3300 MutableLvalueIterator\001 +4 0 0 50 0 19 18 0.0000 4 210 2970 3900 3900 ConstantLvalueIterator\001 +4 0 0 50 0 19 18 0.0000 4 270 2355 9075 2400 SwappableIterator\001 diff --git a/development/libs/iterator/iterator_concepts.gif b/development/libs/iterator/iterator_concepts.gif index 762c0553370a4314dcaeb85aa99811b438dc9d3d..29c38c9f26df88d38a3dfc3c34f29f3a80c38767 100644 GIT binary patch literal 2910 zcmZ?wbh9u|Jj2w+(7*r!|NsBj0ns242Bv>Kyeq5T@-Lp#$I888TIFy4wnrY*o^>vJ zb!yu??&F_)+E2$$?kQE(o6pVFeq_j(;GR?%5GtAO59Vuz3kz}Z@hE${zV?uyT-MRE6%Z5i(}Fp z3DtPB4xc|eBaeN0aw1!+{)mr8dz9&9iTpl?9Sf)L@_yIx?DLC&#kzU-HMY(^vH9`^ z7lrb-AHz)+FKzPBjk~pK^}RV}mQOr({aTkDymrBlKJCt~umtmS zPeKBN;tFbQxA8`V&c3#_T~;l2l}N(*%_8r+=DaFj{9yZ>uQP0K-T2_TY@TcJti)+u z5sMaHP5U*6@9dU~GracO*`AN{v-|WU^AOkUYdMQ&KNVWPznKMNXzENe7q5F>L2yj=0f}az0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^A-L^A`GV+>vy}F^@SdsmsvH5U*qGYnme9>xrHC| zq<5ZObuGAe&L^k(x!M0V#J#C`lWn}av+?Zo>tV%f|0y>dY+F8CefMqe`8~53E5eO_ zYriNrKE=u|`{1MBx3mKf-fZMwo%y+F``x-_R*lEPQ{yDLFLxbPikh*vL}-##lI0&W zZsk|TZkHzPm8zbVyZK$zkF$IBGTP*c{D1e7u`}klag)UTrSER9X8P&&e4h2O0PSso zyQ|+D9;?1;IloxcQu=kzVw={|8L=d_ZZP3E)Grzp*HJHF^`+!sK?(2ff(Tc`@e*N`GzOki+T=;de#*UVpkj99B<%XAuXuU_%X2YrF*0Jibm-Zjj}Hq84ow-wGS30_jrt8m#9H>$tR>a+wx+L4b-Iw!#-^U0qh5KhG}3NL!Y;MqC#s&WuU5w`s>&>H zFH}>n|6ck_xTA8Lk*!knd*Q0d5zz(BSt`>zo*B%^zHXk?cRl)-QfJ=u+>{drj)5gM z!mhJ53_I1sqi@8nyymP~lD$qn-!mfH +

Iterator Concepts

-

The standard iterator concepts (the iterator requirements defined -in the C++ Standard) have a flaw. They glom together two separate -issues into a single set of concepts. The two issues are iterator -traversal and dereference return type semantics. These two issues are -inherently orthogonal and therefore ought to be represented by two -separate sets of concepts. The concepts described here do just -that.

+

The standard iterator categories and requirements are flawed because +they use a single hierarchy of requirements to address two orthogonal +issues: iterator traversal and dereference return +type. The current iterator requirement hierarchy is mainly +geared towards iterator traversal (hence the category names), while +requirements that address dereference return type sneak in at various +places. +

+The iterator requirements should be separated into two hierarchies. One set of concepts handles the return type semantics:

The other set of concepts handles iterator traversal: +The current Input Iterator and Output Iterator requirements will +continue to be used as is. Note that Input Iterator implies Readable +Iterator and Output Iterator implies Writable Iterator. + +

+Note: we considered defining a Single-Pass Iterator, which could be +combined with Readable or Writable Iterator to replace the Input and +Output Iterator requirements. We rejected this idea because there are +some differences between Input and Output Iterators that make it hard +to merge them: for example Input Iterator requires Equality Comparable +while Output Iterator does not. + +

- +
Figure 1: The iterator concepts and refinement relationships.

+

Relationship with the standard iterator concepts

-std::Input Iterator refines boost::Single-Pass Iterator and -boost::ReadableIterator. +std::Input Iterator implies boost::ReadableIterator.

-std::Output Iterator refines boost::Single-Pass Iterator and -boost::Writable Iterator. +std::Output Iterator implies boost::Writable Iterator.

std::Forward Iterator refines boost::Forward Iterator and @@ -106,106 +121,99 @@ boost::Constant Lvalue Iterator or boost::Mutable Lvalue Iterator.

Notation

- - - - - - - - - - - - - - - + + + + + + + + + + + + + + +
XThe iterator type.
TThe value type of X.
x, yAn object of type X.
tAn object of type T.
XThe iterator type.
TThe value type of X, i.e., std::iterator_traits<X>::value_type.
x, yAn object of type X.
tAn object of type T.


+ -

+

Readable Iterator -

+ A Readable Iterator is an iterator that dereferences to produce an rvalue that is convertible to the value_type of the -iterator. For example, derefencing may return a temporary object and -therefore it would be a mistake to bind the result to a reference. -Also, an attempt to assign a value to the result will most likely -cause an error. - -
-  template <class Readable Iterator>
-  void foo(Readable Iterator x)
-  {
-    typedef std::iterator_traits<Readable Iterator>::value_type T;
-    T t = *x;  // Read a value. This is OK.
-    T& s = *x; // Bind to a reference. This is a bad idea.
-    *x = t;    // Try to assign. This is a really bad idea.
-  }
-
- +iterator.

Associated Types

- - - - + + + + - - - - + + + + + + + + + +
Value typeboost::iterator_traits<X>::value_type - The type of the value obtained by dereferencing a LvalueIterator -
Value typestd::iterator_traits<X>::value_typeThe type of the objects pointed to by the iterator.
Return Categoryboost::iterator_traits<X>::return_category - A type convertible to boost::readable_iterator_tag -
Reference typestd::iterator_traits<X>::reference + The return type of dereferencing the iterator. This + type must be convertible to T. +
Return Categorystd::return_category<X>::type + A type convertible to std::readable_iterator_tag +

Refinement of

-Assignable, -Equality Comparable, -Default Constructible +Copy Constructible

Valid expressions

- - - - - - - - - - - - + + + + + + + + + + + +
NameExpressionType requirementsReturn type
Dereference*x Convertible to T.
Member accessx->mT is a type with a member named m. -   -
NameExpressionType requirementsReturn type
Dereference*x std::iterator_traits<X>::reference
Member accessx->mT is a type with a member named m. +If m is a data member, the type of m. +If m is a member function, the return type of m. +


+ -

+

Writable Iterator -

+ A Writable Iterator is an iterator that can be used to store a value using the dereference-assignment expression. @@ -226,12 +234,12 @@ conversions on a. - - - - + + + +
Return Categoryboost::iterator_traits<X>::return_category - A type convertible to boost::writable_iterator_tag -
Return Categorystd::return_category<X>::type + A type convertible to std::writable_iterator_tag +
@@ -240,30 +248,100 @@ conversions on a.

Refinement of

-Assignable, -Equality Comparable, -Default Constructible +Copy Constructible

Valid expressions

- + - - - - - - + + + + + +
NameExpressionReturn type
Dereference assignment*x = aunspecified
Dereference assignment*x = aunspecified

-


-

+
+ + +

+Swappable Iterator +

+ +A Swappable Iterator is an iterator whose dereferenced values can be +swapped. + +

+Note: the requirements for Swappable Iterator are dependent on the +issues surrounding std::swap() being resolved. Here we assume +that the issue will be resolved by allowing the overload of +std::swap() for user-defined types. + +

+Note: Readable Iterator and Writable Iterator combined implies +Swappable Iterator because of the fully templated +std::swap(). However, Swappable Iterator does not imply +Readable Iterator nor Writable Iterator. + +

Associated Types

+ + + + + + + + + +
Return Categorystd::return_category<X>::type + A type convertible to std::swappable_iterator_tag +
+ + +

Valid expressions

+ +Of the two valid expressions listed below, only one OR the +other is required. If std::iter_swap() is overloaded for +X then std::swap() is not required. If +std::iter_swap() is not overloaded for X then the +default (fully templated) version is used, which will call +std::swap() (this means changing the current requirements for +std::iter_swap()). + +

+ + + + + + + + + + + + + + + + + +
NameExpressionReturn type
Iterator Swapstd::iter_swap(x, y)void
Dereference and Swapstd::swap(*x, *y)void
+ +

+ + +


+ + +

Constant Lvalue Iterator -

+ A Constant Lvalue Iterator is an iterator that dereferences to produce a const reference to the pointed-to object, i.e., the associated @@ -275,72 +353,72 @@ iterator.

Refinement of

-Readable Iterator +Readable Iterator

Associated Types

- - - - - - - - - - + + + + - - - - - - - + + + +
Value typeboost::iterator_traits<X>::value_type - The type of the value obtained by dereferencing a Constant Lvalue Iterator. -
Reference typeboost::iterator_traits<X>::reference - The return type of operator*(), which must be +
Reference typestd::iterator_traits<X>::reference + The return type of dereferencing the iterator, which must be const T&. -
POinter typeboost::iterator_traits<X>::pointer + -
Return Categoryboost::iterator_traits<X>::return_category - A type convertible to boost::constant_lvalue_iterator_tag -
Return Categorystd::return_category<X>::type + A type convertible to std::constant_lvalue_iterator_tag +
- + -

+

+ +


+ + +

Mutable Lvalue Iterator -

+ A Mutable Lvalue Iterator is an iterator that dereferences to produce a reference to the pointed-to object. The associated reference @@ -350,8 +428,9 @@ pointers and references previously obtained from that iterator.

Refinement of

-Readable Iterator and -Writable Iterator. +Readable Iterator, +Writable Iterator, +and Swappable Iterator. @@ -359,241 +438,219 @@ pointers and references previously obtained from that iterator. - - - - + + + + - - - - - - - - - - - - - + + + +
Value typeboost::iterator_traits<X>::value_type - The type of the value obtained by dereferencing a Mutable Lvalue Iterator. -
Reference typestd::iterator_traits<X>::referenceThe return type of dereferencing the iterator, which must be + T&.
Reference typeboost::iterator_traits<X>::reference - The return type of operator*(), which is - T&. -
Pointer typeboost::iterator_traits<X>::pointer + -
Return Categoryboost::iterator_traits<X>::return_category - A type convertible to boost::mutable_lvalue_iterator_tag -
Return Categorystd::return_category<X>::type + A type convertible to std::mutable_lvalue_iterator_tag +
- + +


+ -

-Single-Pass Iterator -

+

+Forward Traversal Iterator +

+ +The Forward Iterator is an iterator that can be incremented. Also, it +is permissible to make multiple passes through the iterator's range. + +

Refinement of

+ +Copy Constructible, +Assignable, +Default Constructible, and +Equality Comparable -A Single-Pass Iterator is an iterator that can be incremented to -traverse through a sequence of objects, but the sequence can only be -traversed a single time.

Associated types

- - - - - - - - - + + + + -
Difference typeboost::iterator_traits<X>::difference_type - A signed integral type used to represent the distance from one - iterator to another, or the number of elements in a range. -
Traversal Categoryboost::iterator_traits<X>::traversal_category - A type convertible to boost::single_pass_iterator_tag -
Difference Typestd::iterator_traits<X>::difference_type + A signed integral type used for representing distances + between iterators that point into the same range. +
+ + Traversal Category + std::traversal_category<X>::type + + A type convertible to std::forward_traversal_tag + + +

Valid expressions

- + - - - - - - - - - -
NameExpressionType requirements Return type
Preincrement++i X&
Postincrement(void)i++  
- -

-


- -

-Forward Iterator -

- -The Forward Iterator is an iterator that can be incremented. Also, it -is permissible to make multiple passes through the sequence. - -

Refinement of

- -Single-Pass Iterator - -

Associated types

- - - - - - + + + + + + + +
Traversal Categoryboost::iterator_traits<X>::traversal_category - A type convertible to boost::forward_iterator_tag -
Preincrement++i X&
Postincrementi++ convertible to const X&


+ -

-Bidirectional Iterator -

+

+Bidirectional Traversal Iterator +

An iterator that can be incremented and decremented.

Refinement of

-Forward Iterator +Forward Traversal Iterator

Associated types

- - - - + + + +
Traversal Categoryboost::iterator_traits<X>::traversal_category - A type convertible to boost::bidirectional_iterator_tag -
Traversal Categorystd::traversal_category<X>::type + A type convertible to std::bidirectional_traversal_tag +

Valid expressions

- + - - - - - - + + + + + +
NameExpressionType requirements Return type
Predecrement--i X&
Postdecrementi-- X
Predecrement--i X&
Postdecrementi-- convertible to const X&


+ -

-Random Access Iterator -

+

+Random Access Traversal Iterator +

An iterator that provides constant-time methods for moving forward and -backward in arbitrary-sized steps +backward in arbitrary-sized steps.

Refinement of

-Bidirectional Iterator +Bidirectional Traversal Iterator and +Less Than Comparable where < is a total ordering

Associated types

- - - - + + + +
Traversal Categoryboost::iterator_traits<X>::traversal_category - A type convertible to boost::random_access_iterator_tag -
Traversal Categorystd::traversal_category<X>::type + A type convertible to std::random_access_traversal_tag +

Valid expressions

- + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + +
NameExpressionType requirements
NameExpressionType requirements Return type
Iterator additioni += n X&
Iterator additioni + n or n + i X
Iterator subtractioni -= n X&
Iterator subtractioni - n X
Differencei - j boost::iterator_traits<X>::difference_type
Element operatori[n]X must be a model of - Readable Iterator. The same return type as *i.
Element assignmenti[n] = tX must be a model of - Writable Iterator.unspecified
Iterator additioni += n X&
Iterator additioni + n or n + i X
Iterator subtractioni -= n X&
Iterator subtractioni - n X
Differencei - j std::iterator_traits<X>::difference_type
Element operatori[n]X must also be a model of + Readable Iterator. std::iterator_traits<X>::reference
Element assignmenti[n] = tX must also be a model of + Writable Iterator.unspecified
- -
+