Title
lazy_split_view needs to check the simpleness of Pattern
Status
c++23
Section
[range.lazy.split.view]
Submitter
Tim Song

Created on 2021-09-15.00:00:00 last changed 4 months ago

Messages

Date: 2021-10-14.09:56:08

Proposed resolution:

This wording is relative to N4892.

  1. Modify [range.lazy.split.view], class template lazy_split_view synopsis, as indicated:

    namespace std::ranges {
    
      […]
    
      template<input_range V, forward_range Pattern>
        requires view<V> && view<Pattern> &&
                 indirectly_comparable<iterator_t<V>, iterator_t<Pattern>, ranges::equal_to> &&
                (forward_range<V> || tiny-range<Pattern>)
      class lazy_split_view : public view_interface<lazy_split_view<V, Pattern>> {
      private:
        […]
      public:
        […]
    
        constexpr auto begin() {
          if constexpr (forward_range<V>)
            return outer-iterator<simple-view<V> &&
              simple-view<Pattern>>{*this, ranges::begin(base_)};
          else {
            current_ = ranges::begin(base_);
            return outer-iterator<false>{*this};
          }
        }
        
        […]
        
        constexpr auto end() requires forward_range<V> && common_range<V> {
          return outer-iterator<simple-view<V> &&
            simple-view<Pattern>>{*this, ranges::end(base_)};
        }
    
        […]
      };
      
      […]
      
    }
    
Date: 2021-10-14.00:00:00

[ 2021-10-14 Approved at October 2021 virtual plenary. Status changed: Voting → WP. ]

Date: 2021-09-15.00:00:00

[ 2021-09-24; Reflector poll ]

Set status to Tentatively Ready after six votes in favour during reflector poll.

Date: 2021-09-15.00:00:00

For forward ranges, the non-const versions of lazy_split_view::begin() and lazy_split_view::end() returns an outer-iterator<simple-view<V>>, promoting to const if V models simple-view. However, this failed to take Pattern into account, even though that will also be accessed as const if const-promotion takes place. There is no requirement that const Pattern is a range, however.

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2021-10-14 09:56:08adminsetmessages: + msg12143
2021-10-14 09:56:08adminsetstatus: voting -> wp
2021-09-29 12:57:28adminsetstatus: ready -> voting
2021-09-24 17:55:02adminsetmessages: + msg12073
2021-09-24 17:55:02adminsetstatus: new -> ready
2021-09-17 17:02:06adminsetmessages: + msg12038
2021-09-15 00:00:00admincreate