Created on 2020-01-25.00:00:00 last changed 46 months ago
Proposed resolution:
This wording is relative to N4849.
Modify [range.refinements] as indicated:
-2- contiguous_range additionally requires that the ranges::data customization point ([range.prim.data]) is usable with the range.
template<class T> concept contiguous_range = random_access_range<T> && contiguous_iterator<iterator_t<T>> && requires(T& t) { { ranges::data(t) } -> same_as<add_pointer_t<range_reference_t<T>>>; };-?- Given an expression t such that decltype((t)) is T&, T models contiguous_range only if (to_address(ranges::begin(t)) == ranges::data(t)).
-3- The common_range concept […]
[ 2020-02 Prioritized as IMMEDIATE Monday morning in Prague ]
The definition of the contiguous_range concept in [range.refinements]/2 requires that ranges::data(r) be valid for a contiguous_range r, but fails to impose the obvious semantic requirement that to_address(ranges::begin(r)) == ranges::data(r). In other words, data and begin must agree so that [begin(r), end(r)) and the counted range data(r) + [0, size(r)) (this is the new "counted range" specification syntax per working draft issue 2932) denote the same sequence of elements.
History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2020-02-24 16:02:59 | admin | set | status: immediate -> wp |
2020-02-10 19:13:13 | admin | set | messages: + msg11016 |
2020-02-10 19:13:13 | admin | set | status: new -> immediate |
2020-01-25 15:35:46 | admin | set | messages: + msg10968 |
2020-01-25 00:00:00 | admin | create |