Created on 2024-02-05.00:00:00 last changed 7 months ago
Proposed resolution:
This wording is relative to N4971.
Modify [range.repeat.view], class template repeat_view synopsis, as indicated:
[Drafting note: The proposed wording has been suggested by Casey Carter, see microsoft/STL#3576]
namespace std::ranges { […] template<class T, class Bound = unreachable_sentinel_t> repeat_view(T, Bound = Bound()) -> repeat_view<T, Bound>; }
[ Tokyo 2024-03-23; Status changed: Voting → WP. ]
[ 2024-03-12; Reflector poll ]
Set status to Tentatively Ready after six votes in favour during reflector poll.
Currently, a binary call to std::views::repeat decay the arguments due to the deduction guide, but a unary call doesn't, which is inconsistent.
For example:
#include <concepts>
#include <ranges>
using RPV = std::ranges::repeat_view<const char*>;
static_assert(std::same_as<decltype(std::views::repeat("foo", std::unreachable_sentinel)), RPV>); // OK
static_assert(std::same_as<decltype(std::views::repeat(+"foo", std::unreachable_sentinel)), RPV>); // OK
static_assert(std::same_as<decltype(std::views::repeat("foo")), RPV>); // ill-formed
static_assert(std::same_as<decltype(std::views::repeat(+"foo")), RPV>); // OK
Presumably we should extend the deduction guide of std::ranges::repeat_view to cover the unary cases.
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-04-02 10:29:12 | admin | set | messages: + msg14049 |
2024-04-02 10:29:12 | admin | set | status: voting -> wp |
2024-03-18 09:32:04 | admin | set | status: ready -> voting |
2024-03-12 01:10:06 | admin | set | messages: + msg13995 |
2024-03-12 01:10:06 | admin | set | status: new -> ready |
2024-02-10 15:54:03 | admin | set | messages: + msg13948 |
2024-02-05 00:00:00 | admin | create |