Is it kosher to construct a subrange for which end is not reachable from begin? Say, if begin is reachable from end instead? And size() returns a negative number?
Probably not. If that is the case, we should require that [begin,end) denotes a valid range.
Proposed Resolution
Change [range.subrange.ctor] as follows:
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).
Is it kosher to construct a subrange for which end is not reachable from begin? Say, if begin is reachable from end instead? And
size()returns a negative number?Probably not. If that is the case, we should require that [begin,end) denotes a valid range.
Proposed Resolution
Change [range.subrange.ctor] as follows: