This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of WP status.

3590. split_view::base() const & is overconstrained

Section: 24.7.14.2 [range.split.view] Status: WP Submitter: Tim Song Opened: 2021-09-13 Last modified: 2021-10-17

Priority: Not Prioritized

View all issues with WP status.

Discussion:

Unlike every other range adaptor, split_view::base() const & is constrained on copyable<V> instead of copy_constructible<V>.

Since this function just performs a copy construction, there is no reason to require all of copyablecopy_constructible is sufficient.

[2021-09-24; Reflector poll]

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

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

Proposed resolution:

This wording is relative to N4892.

  1. Modify 24.7.14.2 [range.split.view], class template split_view synopsis, as indicated:

    namespace std::ranges {
      template<forward_range V, forward_range Pattern>
        requires view<V> && view<Pattern> &&
                 indirectly_comparable<iterator_t<V>, iterator_t<Pattern>, ranges::equal_to>
      class split_view : public view_interface<split_view<V, Pattern>> {
      private:
        […]
      public:
        […]
    
        constexpr V base() const& requires copyablecopy_constructible<V> { return base_; }
        constexpr V base() && { return std::move(base_); }
    
        […]
      };