Created on 2023-03-28.00:00:00 last changed 24 months ago
Proposed resolution:
This wording is relative to N4944.
Modify [ranges.syn] as indicated:
template<class T> using iterator_t = decltype(ranges::begin(declval<T&>())); // freestanding template<range R> using sentinel_t = decltype(ranges::end(declval<R&>())); // freestanding template<rangeclass R> using const_iterator_t = const_iterator<iterator_t<R>>; // freestanding template<range R> using const_sentinel_t = const_sentinel<sentinel_t<R>>; // freestanding
[ Kona 2023-11-07; Status changed: Open → NAD. ]
[ Kona 2023-11-07; SG9 ]
SG9 considered this and noted it's obsolete due to LWG 3946.
To support this case now would require changing ranges::cbegin
to add a special case for arrays of unknown bound, which would require a paper.
[ 2023-06-01; Reflector poll ]
Set priority to 3 after reflector poll. Several votes for NAD. Send to SG9 to be looked at with P2836.
ranges::iterator_t<T> is unconstrained; but in contrast,
ranges::const_iterator_t<T> constrains T to be a range,
i.e., it must have an end.
static_assert(std::is_same_v<std::ranges::iterator_t<int(&)[2]>, int*>);
static_assert(std::is_same_v<std::ranges::iterator_t<int(&)[]>, int*>); // OK
static_assert(std::is_same_v<std::ranges::const_iterator_t<int(&)[2]>, const int*>);
static_assert(std::is_same_v<std::ranges::const_iterator_t<int(&)[]>, const int*>); // hard error
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2023-11-07 22:39:32 | admin | set | messages: + msg13827 |
| 2023-11-07 22:39:32 | admin | set | status: open -> nad |
| 2023-11-07 21:10:51 | admin | set | messages: + msg13825 |
| 2023-06-01 14:35:38 | admin | set | messages: + msg13609 |
| 2023-06-01 14:35:38 | admin | set | status: new -> open |
| 2023-03-29 11:00:48 | admin | set | messages: + msg13502 |
| 2023-03-28 00:00:00 | admin | create | |