Title
raw_storage_iterator needs to be a concept-constrained template
Status
nad concepts
Section
[depr.storage.iterator]
Submitter
Alisdair Meredith

Created on 2009-03-11.00:00:00 last changed 171 months ago

Messages

Date: 2010-10-21.18:28:33

Rationale:

raw_storage_iterator has to adapt a ForwardIterator, rather than just an InputIterator for two reasons:

  1. The initial iterator passed by value is expected to remain valid, pointing to the initialized region of memory.
  2. to avoid breaking the declaration of post-increment operator which would require some kind of proxy formulation to support generalised InputIterators.
Date: 2010-10-21.18:28:33

Proposed resolution:

[memory] p2

Update the synopsis for <memory>

// 20.7.8, raw storage iterator:
template <class ForwardIterator OutputIterator, class ObjectType T> 
  requires OutputIterator< OutIter, T >
    class raw_storage_iterator;

template <ForwardIterator OutIter, ObjectType T> 
  requires OutputIterator< OutIter, T >
  concept_map Iterator<raw_storage_iterator< OutIter, T > > { }

[storage.iterator] p1

Replace class template definition with:

namespace std { 
  template <class ForwardIterator OutputIterator, class ObjectType T> 
    requires OutputIterator< OutIter, T >
  class raw_storage_iterator 
    : public iterator<output_iterator_tag,void,void,void,void> { 
  public: 
    explicit raw_storage_iterator(OutputIterator x); 

    raw_storage_iterator<OutputIterator,T>& operator*(); 
    raw_storage_iterator<OutputIterator,T>& operator=(const T& element); 
    raw_storage_iterator<OutputIterator,T>& operator++(); 
    raw_storage_iterator<OutputIterator,T> operator++(int); 
  }; 

  template <ForwardIterator OutIter, ObjectType T> 
    requires OutputIterator< OutIter, T >
    concept_map Iterator<raw_storage_iterator< OutIter, T > > { }
}
Date: 2010-10-21.18:28:33

[ Post Summit Alisdair provided wording and rationale. ]

Date: 2010-10-21.18:28:33

[ Summit: ]

We look forward to a paper on this topic. We recommend no action until a paper is available.

Date: 2012-10-21.13:19:07

Addresses UK 214 [CD1]

raw_storage_iterator needs constraining as an iterator adaptor to be safely used in constrained templates

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg378
2010-10-21 18:28:33adminsetmessages: + msg377
2010-10-21 18:28:33adminsetmessages: + msg376
2010-10-21 18:28:33adminsetmessages: + msg375
2009-03-11 00:00:00admincreate