diff --git a/doc/iter-issue-list.rst b/doc/iter-issue-list.rst index 626991d..779f9f2 100644 --- a/doc/iter-issue-list.rst +++ b/doc/iter-issue-list.rst @@ -802,12 +802,14 @@ object. Is all this mechanism really necessary? c++std-lib-12333: N1550 requires that for a Readable Iterator a of type X, ``*a`` returns an object of type - iterator_traits::reference. ``istreambuf_iterator::operator*`` returns charT, but - istreambuf_iterator::reference is charT&. So am I overlooking something, or is - istreambuf_iterator not Readable + ``iterator_traits::reference``. ``istreambuf_iterator::operator*`` returns ``charT``, but + ``istreambuf_iterator::reference`` is ``charT&``. So am I overlooking something, or is + ``istreambuf_iterator`` not Readable. -:Proposed resolution: **Needs language** (Jeremy) - Remove requirements on the reference type from Readable Iterator. +:Proposed resolution: + Remove all constraints on ``iterator_traits::reference`` in Readable Iterator + and Lvalue Iterator. Change Lvalue Iterator to refer to ``T&`` instead of + ``iterator_traits::reference``. diff --git a/doc/new-iter-concepts.html b/doc/new-iter-concepts.html index 8e5c5a8..28c0280 100755 --- a/doc/new-iter-concepts.html +++ b/doc/new-iter-concepts.html @@ -384,24 +384,12 @@ type T.

Any non-reference, non-cv-qualified type -iterator_traits<X>::reference -R, Convertible to -T -  - *a -Convertible to R, -Convertible to T +Convertible to T pre: a is dereferenceable. If a == b then *a is -equivalent to *b - -static_cast<T>( -static_cast<R>(*a) ) -T -equivalent to -static_cast<T>(*a) +equivalent to *b. a->m U& @@ -411,10 +399,8 @@ to (*a).m - +

Writable Iterators [lib.writable.iterators]

@@ -480,8 +466,9 @@ 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.

+

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

@@ -493,16 +480,20 @@ exchanged - + - + +cv-qualification. +pre: a is +dereferenceable. If a +== b then *a is +equivalent to *b.
Expression Return TypeAssertionNote/Assertion
iterator_traits<X>::reference
*a T& T is cv iterator_traits<X>::value_type where cv is an optional -cv-qualification
@@ -889,7 +880,7 @@ LocalWords: TraversalTag typename lvalues DWA Hmm JGS mis enum --> diff --git a/doc/new-iter-concepts.rst b/doc/new-iter-concepts.rst index 7dfe2b5..c33115a 100644 --- a/doc/new-iter-concepts.rst +++ b/doc/new-iter-concepts.rst @@ -368,26 +368,18 @@ type ``T``. |``iterator_traits::value_type`` |``T`` |Any non-reference, | | | |non-cv-qualified type | +-----------------------------------+------------------------+-------------------------+ -|``iterator_traits::reference`` |``R``, Convertible to | | -| |``T`` | | -+-----------------------------------+------------------------+-------------------------+ -|``*a`` |Convertible to ``R``, |pre: ``a`` is | -| |Convertible to ``T`` |dereferenceable. If ``a | +|``*a`` | Convertible to ``T`` |pre: ``a`` is | +| | |dereferenceable. If ``a | | | |== b`` then ``*a`` is | -| | |equivalent to ``*b`` | -+-----------------------------------+------------------------+-------------------------+ -|``static_cast( |``T`` |equivalent to | -|static_cast(*a) )`` | |``static_cast(*a)`` | +| | |equivalent to ``*b``. | +-----------------------------------+------------------------+-------------------------+ |``a->m`` |``U&`` |pre: ``(*a).m`` is | | | |well-defined. Equivalent| | | |to ``(*a).m`` | +-----------------------------------+------------------------+-------------------------+ -.. TR1: the originally-proposed requirement that typeof(*a) == R - was too restrictive. Now we just require that it's - convertible to R and that accessing a T through that conversion - is equivalent to accessing a T directly. +.. We won't say anything about iterator_traits::reference until + the DR is resolved. .. _Writable Iterator: @@ -432,21 +424,27 @@ expressions are valid and respect the stated semantics. 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. +The *Lvalue Iterator* concept adds the requirement that the return +type of ``operator*`` type be a reference to the value type of the +iterator. +---------------------------------------------------------------------------------+ | Lvalue Iterator Requirements | +---------------------------------+-----------+-----------------------------------+ -|Expression |Return Type|Assertion | +|Expression |Return Type|Note/Assertion | +=================================+===========+===================================+ -|``iterator_traits::reference``|``T&`` |``T`` is *cv* | +|``*a`` | ``T&`` |``T`` is *cv* | | | |``iterator_traits::value_type`` | | | |where *cv* is an optional | -| | |cv-qualification | +| | |cv-qualification. | +| | |pre: ``a`` is | +| | |dereferenceable. If ``a | +| | |== b`` then ``*a`` is | +| | |equivalent to ``*b``. | +---------------------------------+-----------+-----------------------------------+ + Iterator Traversal Concepts [lib.iterator.traversal] ++++++++++++++++++++++++++++++++++++++++++++++++++++