Created on 2021-09-08.00:00:00 last changed 13 months ago
Proposed resolution:
This wording is relative to N4892.
Modify [range.subrange] as indicated:
namespace std::ranges { […] template<size_t N, class I, class S, subrange_kind K> requires ((N< 2== 0 && copyable<I>) || N == 1) constexpr auto get(const subrange<I, S, K>& r); template<size_t N, class I, class S, subrange_kind K> requires (N < 2) constexpr auto get(subrange<I, S, K>&& r); }
Modify [range.subrange.access] as indicated:
[…] template<size_t N, class I, class S, subrange_kind K> requires ((N< 2== 0 && copyable<I>) || N == 1) constexpr auto get(const subrange<I, S, K>& r); template<size_t N, class I, class S, subrange_kind K> requires (N < 2) constexpr auto get(subrange<I, S, K>&& r);-10- Effects: Equivalent to:
if constexpr (N == 0) return r.begin(); else return r.end();
[ 2021-10-14 Approved at October 2021 virtual plenary. Status changed: Voting → WP. ]
[ 2021-09-20; Reflector poll ]
Set status to Tentatively Ready after six votes in favour during reflector poll.
[ 2021-09-20; Reflector poll ]
Set priority to 3 after reflector poll.
The const lvalue reference overload of get used for subrange only constraint that N < 2, this will cause the "discards qualifiers" error inside the function body when applying get to the lvalue subrange that stores a non-copyable iterator since its begin() is non-const qualified, we probably need to add a constraint for it.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2021-10-14 09:56:08 | admin | set | messages: + msg12140 |
2021-10-14 09:56:08 | admin | set | status: voting -> wp |
2021-09-29 12:57:28 | admin | set | status: ready -> voting |
2021-09-20 13:52:41 | admin | set | messages: + msg12060 |
2021-09-20 13:52:41 | admin | set | status: new -> ready |
2021-09-20 11:22:03 | admin | set | messages: + msg12054 |
2021-09-11 13:51:19 | admin | set | messages: + msg12032 |
2021-09-08 00:00:00 | admin | create |