Title
Useless constraint in split_view::outer-iterator::value_type::begin()
Status
c++23
Section
[range.lazy.split.outer.value]
Submitter
Hewill Kang

Created on 2021-05-18.00:00:00 last changed 13 months ago

Messages

Date: 2021-06-07.16:58:04

Proposed resolution:

This wording is relative to N4885.

  1. Modify [range.split.outer.value], class split_view::outer-iterator::value_type 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>)
      template<bool Const>
      struct split_view<V, Pattern>::outer-iterator<Const>::value_type
        : view_interface<value_type> {
      private:
        outer-iterator i_ = outer-iterator(); // exposition only
      public:
        value_type() = default;
        constexpr explicit value_type(outer-iterator i);
        constexpr inner-iterator<Const> begin() const requires copyable<outer-iterator>;
        constexpr inner-iterator<Const> begin() requires (!copyable<outer-iterator>);
        constexpr default_sentinel_t end() const;
      };
    }
    
    […]
    constexpr inner-iterator<Const> begin() const requires copyable<outer-iterator>;
    

    -2- Effects: Equivalent to: return inner-iterator<Const>{i_};

    constexpr inner-iterator<Const> begin() requires (!copyable<outer-iterator>);
    

    -3- Effects: Equivalent to: return inner-iterator<Const>{std::move(i_)};

    […]
Date: 2021-06-07.00:00:00

[ 2021-06-07 Approved at June 2021 virtual plenary. Status changed: Voting → WP. ]

Date: 2021-05-15.00:00:00

[ 2021-05-26; Reflector poll ]

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

Date: 2021-05-23.06:58:21

The copyable constraint in split_view::outer-iterator::value_type::begin() is useless because outer-iterator always satisfies copyable.

When V does not model forward_range, the outer-iterator only contains a pointer, so it is obviously copyable; When V is a forward_range, the iterator_t<Base> is a forward_iterator, so it is copyable, which makes outer-iterator also copyable.

Suggested resolution: Remove the no-const begin() and useless copyable constraint in [range.split.outer.value].

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2021-06-07 16:58:04adminsetmessages: + msg11915
2021-06-07 16:58:04adminsetstatus: voting -> wp
2021-05-26 21:11:22adminsetstatus: ready -> voting
2021-05-26 10:53:33adminsetmessages: + msg11858
2021-05-26 10:53:33adminsetstatus: new -> ready
2021-05-22 19:58:55adminsetmessages: + msg11842
2021-05-18 00:00:00admincreate