Created on 2023-01-06.00:00:00 last changed 12 months ago
Proposed resolution:
This wording is relative to N4917.
Modify [range.adjacent.view] as indicated:
namespace std::ranges { template<forward_range V, size_t N> requires view<V> && (N > 0) class adjacent_view : public view_interface<adjacent_view<V, N>> { V base_ = V(); // exposition only […] public: adjacent_view() requires default_initializable<V> = default; constexpr explicit adjacent_view(V base); constexpr V base() const & requires copy_constructible<V> { return base_; } constexpr V base() && { return std::move(base_); } […] }; }
Modify [range.adjacent.transform.view] as indicated:
namespace std::ranges { template<forward_range V, move_constructible F, size_t N> requires view<V> && (N > 0) && is_object_v<F> && regular_invocable<F&, REPEAT(range_reference_t<V>, N)...> && can-reference<invoke_result_t<F&, REPEAT(range_reference_t<V>, N)...>> class adjacent_transform_view : public view_interface<adjacent_transform_view<V, F, N>> { movable-box<F> fun_; // exposition only adjacent_view<V, N> inner_; // exposition only using InnerView = adjacent_view<V, N>; // exposition only […] public: adjacent_transform_view() = default; constexpr explicit adjacent_transform_view(V base, F fun); constexpr V base() const & requires copy_constructible<InnerView> { return inner_.base(); } constexpr V base() && { return std::move(inner_).base(); } […] }; }
Modify [range.slide.view] as indicated:
namespace std::ranges { […] template<forward_range V> requires view<V> class slide_view : public view_interface<slide_view<V>> { V base_; // exposition only range_difference_t<V> n_; // exposition only […] public: constexpr explicit slide_view(V base, range_difference_t<V> n); constexpr V base() const & requires copy_constructible<V> { return base_; } constexpr V base() && { return std::move(base_); } […] }; […] }
[ 2023-02-13 Approved at February 2023 meeting in Issaquah. Status changed: Voting → WP. ]
[ 2023-02-01; Reflector poll ]
Set status to Tentatively Ready after seven votes in favour during reflector poll.
Like most range adaptors, these three views accept a single range and store it as a member variable. However, they do not provide a base() member function for accessing the underlying range, which seems like an oversight.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2023-02-13 10:17:57 | admin | set | messages: + msg13368 |
2023-02-13 10:17:57 | admin | set | status: voting -> wp |
2023-02-06 15:33:48 | admin | set | status: ready -> voting |
2023-02-01 20:28:28 | admin | set | messages: + msg13242 |
2023-02-01 20:28:28 | admin | set | status: new -> ready |
2023-01-06 16:24:01 | admin | set | messages: + msg13183 |
2023-01-06 00:00:00 | admin | create |