Title
Initialize data members of ranges and their iterators
Status
c++20
Section
[range.take.while.view][range.drop.view] [range.drop.while.view][range.elements.iterator]
Submitter
Johel Ernesto Guerrero Peña

Created on 2020-01-07.00:00:00 last changed 38 months ago

Messages

Date: 2020-01-14.11:58:48

Proposed resolution:

This wording is relative to N4842.

  1. Modify [range.take.while.view] as follows:

    class take_while_view : public view_interface<take_while_view<V, Pred>> {
      template<bool> class sentinel;                      // exposition only
    
      V base_ = V();                                      // exposition only
      semiregular-box<Pred> pred_;                        // exposition only
    
    public:
    
  2. Modify [range.drop.view] as follows:

    private:
      V base_ = V();                                     // exposition only
      range_difference_t<V> count_ = 0;                  // exposition only
    };
    
  3. Modify [range.drop.while.view] as follows:

    private:
      V base_ = V();                                     // exposition only
      semiregular-box<Pred> pred_;                       // exposition only
    };
    
  4. Modify [range.elements.iterator] as follows:

    class elements_view<V, N>::iterator {                // exposition only
      using base-t = conditional_t<Const, const V, V>;
      friend iterator<!Const>;
    
      iterator_t<base-t> current_ = iterator_t<base-t>();
    public:
    
Date: 2020-01-14.00:00:00

[ 2020-01-14 Status set to Tentatively Ready after five positive votes on the reflector. ]

Date: 2020-01-07.00:00:00

Before P1035 was accepted, no data member in [ranges] whose type could potentially be an aggregate or fundamental type was left without initializer. P1035 left some such data members without initializer, so it is possible to have them have indeterminate values. We propose restoring consistency.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2020-02-24 16:02:59adminsetstatus: immediate -> wp
2020-02-14 06:37:09adminsetstatus: ready -> immediate
2020-01-14 11:58:48adminsetmessages: + msg10928
2020-01-14 11:58:48adminsetstatus: new -> ready
2020-01-07 15:44:42adminsetmessages: + msg10918
2020-01-07 00:00:00admincreate