From 24052c3dffbc2b6228552404c7eaa910fed2293b Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Mon, 12 Jan 2004 18:07:12 +0000 Subject: [PATCH] a couple edits [SVN r21636] --- doc/iter-issue-list.rst | 6 +++- doc/iterator_adaptor.html | 61 +++++++++++++++++++----------------- doc/new-iter-concepts.html | 63 ++++++++++++++++++++------------------ doc/new-iter-concepts.rst | 37 ++++++++++++---------- 4 files changed, 93 insertions(+), 74 deletions(-) diff --git a/doc/iter-issue-list.rst b/doc/iter-issue-list.rst index c854900..f5d6e40 100644 --- a/doc/iter-issue-list.rst +++ b/doc/iter-issue-list.rst @@ -176,11 +176,15 @@ iterator_adaptor(Base) has no Requires clause, although the Returns clause says member is copy construced from the argument (this may actually be an oversight in N1550, which doesn't require iterators to be copy constructible or assignable). -:Proposed resolution: **Needs work** (Jeremy) +:Proposed resolution: Add a requirements section for the template parameters of iterator_adaptor, and state that Base must be Copy Constructible and Assignable. + N1550 does in fact include requirements for copy constructible + and assignable in the requirements tables. To clarify, we've also + added the requirements to the text. + 9.8 Specialized adaptors text should be normative ================================================= diff --git a/doc/iterator_adaptor.html b/doc/iterator_adaptor.html index f03707a..40125b0 100644 --- a/doc/iterator_adaptor.html +++ b/doc/iterator_adaptor.html @@ -3,7 +3,7 @@ - + Iterator Adaptor @@ -59,11 +59,12 @@ core interface functions of iterator_facad @@ -119,13 +120,13 @@ rights reserved. --> template < class Derived , class Base - , class Value = use_default - , class CategoryOrTraversal = use_default - , class Reference = use_default + , class Value = use_default + , class CategoryOrTraversal = use_default + , class Reference = use_default , class Difference = use_default > class iterator_adaptor - : public iterator_facade<Derived, V, C, R, D> // see details + : public iterator_facade<Derived, V, C, R, D> // see details { friend class iterator_core_access; public: @@ -157,8 +158,14 @@ class iterator_adaptor Base m_iterator; // exposition only }; -
-

iterator_adaptor base class parameters

+
+

iterator_adaptor requirements

+

The Derived template argument must be a publicly derived from +iterator_adaptor.

+

The Base argument shall be Assignable and Copy Constructible.

+
+
+

iterator_adaptor base class parameters

The V, C, R, and D parameters of the iterator_facade used as a base class in the summary of iterator_adaptor above are defined as follows:

@@ -187,20 +194,18 @@ above are defined as follows:

return Difference
-
-

iterator_adaptor usage

-

The Derived template parameter must be a publicly derived from -iterator_adaptor. In order for Derived to model the -iterator concepts corresponding to -iterator_traits<Derived>::iterator_category, the expressions -involving m_iterator in the specifications of those private -member functions of iterator_adaptor that may be called by -iterator_facade<Derived, V, C, R, D> -in evaluating any valid expression involving Derived -in those concepts' requirements.

+
+

iterator_adaptor models

+

In order for Derived to model the iterator concepts corresponding +to iterator_traits<Derived>::iterator_category, the expressions +involving m_iterator in the specifications of those private member +functions of iterator_adaptor that may be called by +iterator_facade<Derived, V, C, R, D> in evaluating any valid +expression involving Derived in those concepts' requirements.

+
-

iterator_adaptor public operations

+

iterator_adaptor public operations

iterator_adaptor();

@@ -234,7 +239,7 @@ in those concepts' requirements.

-

iterator_adaptor protected member functions

+

iterator_adaptor protected member functions

Base const& base_reference() const;

@@ -255,7 +260,7 @@ in those concepts' requirements.

-

iterator_adaptor private member functions

+

iterator_adaptor private member functions

typename iterator_adaptor::reference dereference() const;

@@ -324,10 +329,10 @@ typename iterator_adaptor::difference_type distance_to( - + diff --git a/doc/new-iter-concepts.html b/doc/new-iter-concepts.html index 6f2f033..8bc5c0d 100755 --- a/doc/new-iter-concepts.html +++ b/doc/new-iter-concepts.html @@ -3,7 +3,7 @@ - +New Iterator Concepts @@ -107,7 +107,7 @@ geared towards iterator traversal (hence the category names), while requirements that address value access sneak in at various places. The following table gives a summary of the current value access requirements in the iterator categories.

-
+
@@ -360,17 +360,18 @@ object of type T.

Readable Iterators [lib.readable.iterators]

A class or built-in type X models the Readable Iterator concept -for the value type T if the following expressions are valid and -respect the stated semantics. U is the type of any specified -member of type T.

-
+for value type T if, in addition to X being Assignable and +Copy Constructible, the following expressions are valid and respect +the stated semantics. U is the type of any specified member of +type T.

+
- + @@ -418,16 +419,17 @@ is equivalent to accessing a T directly. -->

Writable Iterators [lib.writable.iterators]

A class or built-in type X models the Writable Iterator concept -if the following expressions are valid and respect the stated -semantics. Writable Iterators have an associated set of value types.

-
Readable Iterator Requirements (in addition to CopyConstructible)
Readable Iterator Requirements (in addition to Assignable and Copy Constructible)
Expression Return Type
+if, in addition to X being Copy Constructible, the following +expressions are valid and respect the stated semantics. Writable +Iterators have an associated set of value types.

+
- + @@ -447,16 +449,16 @@ value types of X

Swappable Iterators [lib.swappable.iterators]

A class or built-in type X models the Swappable Iterator concept -if the following expressions are valid and respect the stated -semantics.

-
Writable Iterator Requirements (in addition to CopyConstructible)
Writable Iterator Requirements (in addition to Copy Constructible)
Expression Return Type
+if, in addition to X being Copy Constructible, the following +expressions are valid and respect the stated semantics.

+
- + @@ -480,7 +482,7 @@ exchanged

Lvalue Iterators [lib.lvalue.iterators]

The Lvalue Iterator concept adds the requirement that the reference type be a reference to the value type of the iterator.

-
Swappable Iterator Requirements (in addition to CopyConstructible)
Swappable Iterator Requirements (in addition to Copy Constructible)
Expression Return Type
+
@@ -515,9 +517,10 @@ type X,

Incrementable Iterators [lib.incrementable.iterators]

A class or built-in type X models the Incrementable Iterator -concept if the following expressions are valid and respect the stated -semantics.

-
+concept if, in addition to X being Assignable and Copy +Constructible, the following expressions are valid and respect the +stated semantics.

+
@@ -562,7 +565,7 @@ incrementable_traversal_tag for consistency. -->

A class or built-in type X models the Single Pass Iterator concept if the following expressions are valid and respect the stated semantics.

-
+
@@ -608,9 +611,10 @@ single_pass_traversal_tag for consistency -->

Forward Traversal Iterators [lib.forward.traversal.iterators]

A class or built-in type X models the Forward Traversal Iterator -concept if the following expressions are valid and respect the stated -semantics.

-
+concept if, in addition to X meeting the requirements of Single +Pass Iterator, the following expressions are valid and respect the +stated semantics.

+
@@ -657,9 +661,10 @@ forward_traversal_tag for consistency -->

Bidirectional Traversal Iterators [lib.bidirectional.traversal.iterators]

A class or built-in type X models the Bidirectional Traversal -Iterator concept if the following expressions are valid and respect -the stated semantics.

-
+Iterator concept if, in addition to X meeting the requirements of +Forward Traversal Iterator, the following expressions are valid and +respect the stated semantics.

+
@@ -715,7 +720,7 @@ Iterator concept if the following expressions are valid and respect the stated semantics. In the table below, Distance is iterator_traits<X>::difference_type and n represents a constant object of type Distance.

-
+
@@ -881,10 +886,10 @@ LocalWords: incrementable xxx min prev inplace png oldeqnew AccessTag struct LocalWords: TraversalTag typename lvalues DWA Hmm JGS mis enum --> - + diff --git a/doc/new-iter-concepts.rst b/doc/new-iter-concepts.rst index 027e13d..7dfe2b5 100644 --- a/doc/new-iter-concepts.rst +++ b/doc/new-iter-concepts.rst @@ -355,12 +355,13 @@ Readable Iterators [lib.readable.iterators] ------------------------------------------- A class or built-in type ``X`` models the *Readable Iterator* concept -for the value type ``T`` if the following expressions are valid and -respect the stated semantics. ``U`` is the type of any specified -member of type ``T``. +for value type ``T`` if, in addition to ``X`` being Assignable and +Copy Constructible, the following expressions are valid and respect +the stated semantics. ``U`` is the type of any specified member of +type ``T``. +--------------------------------------------------------------------------------------+ -|Readable Iterator Requirements (in addition to CopyConstructible) | +|Readable Iterator Requirements (in addition to Assignable and Copy Constructible) | +-----------------------------------+------------------------+-------------------------+ |Expression |Return Type |Note/Precondition | +===================================+========================+=========================+ @@ -394,11 +395,12 @@ Writable Iterators [lib.writable.iterators] ------------------------------------------- A class or built-in type ``X`` models the *Writable Iterator* concept -if the following expressions are valid and respect the stated -semantics. Writable Iterators have an associated *set of value types*. +if, in addition to ``X`` being Copy Constructible, the following +expressions are valid and respect the stated semantics. Writable +Iterators have an associated *set of value types*. +---------------------------------------------------------------------+ -|Writable Iterator Requirements (in addition to CopyConstructible) | +|Writable Iterator Requirements (in addition to Copy Constructible) | +-------------------------+--------------+----------------------------+ |Expression |Return Type |Precondition | +=========================+==============+============================+ @@ -411,11 +413,11 @@ Swappable Iterators [lib.swappable.iterators] --------------------------------------------- A class or built-in type ``X`` models the *Swappable Iterator* concept -if the following expressions are valid and respect the stated -semantics. +if, in addition to ``X`` being Copy Constructible, the following +expressions are valid and respect the stated semantics. +---------------------------------------------------------------------+ -|Swappable Iterator Requirements (in addition to CopyConstructible) | +|Swappable Iterator Requirements (in addition to Copy Constructible) | +-------------------------+-------------+-----------------------------+ |Expression |Return Type |Postcondition | +=========================+=============+=============================+ @@ -458,8 +460,9 @@ Incrementable Iterators [lib.incrementable.iterators] ----------------------------------------------------- A class or built-in type ``X`` models the *Incrementable Iterator* -concept if the following expressions are valid and respect the stated -semantics. +concept if, in addition to ``X`` being Assignable and Copy +Constructible, the following expressions are valid and respect the +stated semantics. +-------------------------------------------------------------------------------------+ @@ -522,8 +525,9 @@ Forward Traversal Iterators [lib.forward.traversal.iterators] ------------------------------------------------------------- A class or built-in type ``X`` models the *Forward Traversal Iterator* -concept if the following expressions are valid and respect the stated -semantics. +concept if, in addition to ``X`` meeting the requirements of Single +Pass Iterator, the following expressions are valid and respect the +stated semantics. +-------------------------------------------------------------------------------------------+ |Forward Traversal Iterator Requirements (in addition to Single Pass Iterator) | @@ -556,8 +560,9 @@ Bidirectional Traversal Iterators [lib.bidirectional.traversal.iterators] ------------------------------------------------------------------------- A class or built-in type ``X`` models the *Bidirectional Traversal -Iterator* concept if the following expressions are valid and respect -the stated semantics. +Iterator* concept if, in addition to ``X`` meeting the requirements of +Forward Traversal Iterator, the following expressions are valid and +respect the stated semantics. +--------------------------------------------------------------------------------------------------------+ |Bidirectional Traversal Iterator Requirements (in addition to Forward Traversal Iterator) |