From 633bb0762e74de1a5e1f87505d55c0cf70091ce4 Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Wed, 19 Nov 2003 01:24:28 +0000 Subject: [PATCH] new version [SVN r20852] --- doc/issues.html | 303 ++++-------------------------------------------- 1 file changed, 25 insertions(+), 278 deletions(-) diff --git a/doc/issues.html b/doc/issues.html index 5b89021..8087b45 100755 --- a/doc/issues.html +++ b/doc/issues.html @@ -3,200 +3,9 @@ - + Problem with is_writable and is_swappable in N1550 - +
@@ -223,13 +32,13 @@ at http://www.b
-

Introduction

+

Introduction

The is_writable and is_swappable traits classes in N1550 provide a mechanism for determining at compile time if an iterator type is a model of the new Writable Iterator and Swappable Iterator @@ -271,7 +80,7 @@ attempting to write into B wil

The same problem applies to is_swappable.

-

Proposed Resolution

+

Proposed Resolution

  1. Remove the is_writable and is_swappable traits, and remove the requirements in the Writable Iterator and Swappable Iterator concepts @@ -281,68 +90,14 @@ that require their models to support these traits.

    is_readable<X>::type is true_type if the result type of X::operator* is convertible to iterator_traits<X>::value_type and is false_type -otherwise.

    +otherwise. Also, is_readable is required to satisfy +the requirements for the UnaryTypeTrait concept +(defined in the type traits proposal).

    Remove the requirement for support of the is_readable trait from the Readable Iterator concept.

  2. -
- -
    -
  1. Change iterator_tag to:

    -
    -template <class Value, class Reference, class Traversal>
    -struct iterator_tag;
    -
    -

    The argument for Value must be the value_type of the -iterator, possibly const-qualified, Reference must be the -return type of operator* *, and Traversal the -traversal tag for the iterator.

    +
  2. Remove the iterator_tag class.

  3. -
- - - - - - - -
[*]Instead of saying "return type of operator*", we could have -said iterator_traits<X>::reference. However, the standard -specifies nothing about iterator_traits<X>::reference in -many cases, which we believe is a defect. Furthermore, in some -cases it explicitly differs from the return type of -operator*, for example see istreambuf_iterator.
-
  1. Change the specification of traversal_category to:

     traversal-category(Iterator) =
    @@ -366,7 +121,7 @@ traversal-category(Iterator) =
     
-

Rationale

+

Rationale

  1. There are two reasons for removing is_writable and is_swappable. The first is that we do not know of @@ -387,32 +142,24 @@ using only the iterator type itself and its is_readable from the Readable Iterator concept, and change the definition of is_readable so that it works for any iterator type.
  2. -
  3. With is_writable and is_swappable gone, and +
  4. The purpose of the iterator_tag class was to +bundle the traversal and access category tags +into the iterator_category typedef. +With is_writable and is_swappable gone, and is_readable no longer in need of special hints, -there is no reason for the iterator_tag class to provide +there is no reason for iterators to provide information about the access capabilities of an iterator. -This new version provides only information about the traversal -capabilities and the old iterator category tag. Instead of accessing -the traversal category as a nested typedef ::traversal, -the iterator_tag itself will be convertible to the traversal -tag. The access_bits parameter is no longer needed for -specifying the access member (which is now gone). However, -some access information is still needed so that we can -deduce the appropriate old iterator category. The -Value and Reference parameters fill this need. -Note that this solution cleans up the issue that John -Maddock raised on the reflector (c++std-lib-12187) about the non-uniformity -of the lvalue bit.
  5. +Thus there is no need for the iterator_tag. The +traversal tag can be directly used for the +iterator_category. If a new iterator is intended to be backward +compatible with old iterator concepts, a tag type +that is convertible to both one of the new traversal tags +and also to an old iterator tag can be created and use +for the iterator_category.
  6. The changes to the specification of traversal_category are a -direct result of the changes to iterator_tag.
  7. +direct result of the removal of iterator_tag.
- -