Title
Add raw_storage_iterator::base() member
Status
c++17
Section
[depr.storage.iterator]
Submitter
Jonathan Wakely

Created on 2014-11-11.00:00:00 last changed 89 months ago

Messages

Date: 2015-04-01.18:04:26

Proposed resolution:

This wording is relative to N4140.

  1. Add a new function to the synopsis in [storage.iterator] p1:

    namespace std {
      template <class OutputIterator, class 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);
        OutputIterator base() const;
    };
    }
    
  2. Insert the new function and a new paragraph series after p7:

    OutputIterator base() const;
    

    -?- Returns: An iterator of type OutputIterator that points to the same value as *this points to.

Date: 2015-04-01.18:04:26

[ 2015-02 Cologne ]

NJ: Is this "const" correct [in "base()"]? DK: Yes, we always do that. NJ: And the output iterator is not qualifying in any way? AM/DK: That wouldn't make sense. NJ: OK.

VV: What did LEWG say about this feature request? In other words, why is this a library issue? AM: LEWG/JY thought this wouldn't be a contentious issue.

NJ: I really hope the split of LEWG and LWG will be fixed soon, since it's only wasting time. VV: So you want to spend even more of your time on discussions that LEWG has?

AM: I think this specified correctly. I'm not wild about it. But no longer bothered to stand in its way.

GR: Why do we need to repeat the type in "Returns" even though it's part of the synopsis? AM: Good point, but not worth fixing.

NJ: Why is "base()" for reverse_iterator commented with "// explicit"? AM: I guess in 1998 that was the only way to say this.

AM: So, it's tentatively ready.

Date: 2014-11-11.00:00:00

Eric Niebler pointed out that raw_storage_iterator should give access to the OutputIterator it wraps.

This helps alleviate the exception-safety issue pointed out in the discussion of LWG 2127, as an exception can be caught and then destructors can be run for the constructed elements in the range [begin, raw.base())

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2015-05-22 18:31:21adminsetstatus: ready -> wp
2015-04-01 18:04:26adminsetmessages: + msg7295
2015-04-01 18:04:26adminsetstatus: new -> ready
2014-11-17 21:16:47adminsetmessages: + msg7194
2014-11-11 00:00:00admincreate