Created on 2019-02-13.00:00:00 last changed 58 months ago
Proposed resolution:
This wording is relative to N4849.
Modify [ranges.syn], header <ranges> synopsis, as indicated:
[…]
namespace std {
namespace views = ranges::views;
template<class I, class S, ranges::subrange_kind K>
struct tuple_size<ranges::subrange<I, S, K>>
: integral_constant<size_t, 2> {};
template<class I, class S, ranges::subrange_kind K>
struct tuple_element<0, ranges::subrange<I, S, K>> {
using type = I;
};
template<class I, class S, ranges::subrange_kind K>
struct tuple_element<1, ranges::subrange<I, S, K>> {
using type = S;
};
template<class I, class S, ranges::subrange_kind K>
struct tuple_element<0, const ranges::subrange<I, S, K>> {
using type = I;
};
template<class I, class S, ranges::subrange_kind K>
struct tuple_element<1, const ranges::subrange<I, S, K>> {
using type = S;
};
}
[ 2020-02-14, Prague ]
LWG decided to remove the volatile support, we shouldn't give the impression to support an idiom that wouldn't work.
As currently specified, it uses the cv-qualified partial specialization, which incorrectly adds cv-qualification to the element type.
Previous resolution [SUPERSEDED]:This wording is relative to N4849.
Modify [ranges.syn], header <ranges> synopsis, as indicated:
[…] namespace std { namespace views = ranges::views; template<class I, class S, ranges::subrange_kind K> struct tuple_size<ranges::subrange<I, S, K>> : integral_constant<size_t, 2> {}; template<class I, class S, ranges::subrange_kind K> struct tuple_element<0, ranges::subrange<I, S, K>> { using type = I; }; template<class I, class S, ranges::subrange_kind K> struct tuple_element<1, ranges::subrange<I, S, K>> { using type = S; }; template<class I, class S, ranges::subrange_kind K> struct tuple_element<0, const ranges::subrange<I, S, K>> { using type = I; }; template<class I, class S, ranges::subrange_kind K> struct tuple_element<1, const ranges::subrange<I, S, K>> { using type = S; }; }Add the following wording to Annex D:
D.? Deprecated subrange tuple interface [depr.ranges.syn]
1 The header <ranges> ([ranges.syn]) has the following additions:namespace std { template<size_t X, class I, class S, ranges::subrange_kind K> struct tuple_element<X, volatile ranges::subrange<I, S, K>> {}; template<size_t X, class I, class S, ranges::subrange_kind K> struct tuple_element<X, const volatile ranges::subrange<I, S, K>> {}; }
| 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-14 16:06:37 | admin | set | messages: + msg11131 |
| 2020-02-14 16:06:37 | admin | set | status: new -> immediate |
| 2020-02-13 21:09:02 | admin | set | messages: + msg11086 |
| 2019-02-13 00:00:00 | admin | create | |