Created on 2018-12-21.00:00:00 last changed 46 months ago
Proposed resolution:
This wording is relative to N4791.
Change [range.subrange.ctor] as indicated:
constexpr subrange(I i, S s) requires (!StoreSize);-?- Expects: [i, s) is a valid range.
-1- Effects: Initializes begin_ with i and end_ with s.
constexpr subrange(I i, S s, iter_difference_t<I> n) requires (K == subrange_kind::sized);-2- Expects: [i, s) is a valid range, and n == ranges::distance(i, s).
[ 2019-01-20 Reflector prioritization ]
Set Priority to 0 and status to Tentatively Ready
The constructors of subrange place no requirements on the iterator and sentinel values from which a subrange is constructed. They allow constructions like subrange{myvec.end(), myvec.begin()} in which the resulting subrange isn't in the domain of the Range concept which requires that "[ranges::begin(r), ranges::end(r)) denotes a range" ([range.range]/3.1). We should forbid the construction of abominable values like this to enforce the useful semantic that values of subrange are always in the domain of Range.
(From ericniebler/stl2#597.)
History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2019-02-26 17:40:23 | admin | set | status: voting -> wp |
2019-01-21 04:50:04 | admin | set | status: ready -> voting |
2019-01-20 16:20:00 | admin | set | messages: + msg10292 |
2019-01-20 16:20:00 | admin | set | status: new -> ready |
2018-12-21 18:25:19 | admin | set | messages: + msg10270 |
2018-12-21 00:00:00 | admin | create |