Closed
Description
In [array.tuple] (in N4778 and 4788), we see:
template<class T, size_t N>
struct tuple_size<array<T, N>> : integral_constant<size_t, N> { };
tuple_element<I, array<T, N>>::type
I'm thinking that the tuple_element
bit should look more like this:
template<class T, size_t N>
tuple_element<I, array<T, N>>::type
Activity
jwakely commentedon Dec 3, 2018
It needs
size_t I
as well.I think this style of presentation is intentional, not a mistake. That doesn't make it good though.
jwakely commentedon Dec 3, 2018
See [pair.astuple] and [variant.helper] as well.
tkoeppe commentedon Dec 3, 2018
Looks like this has been broken size the first commit.
tkoeppe commentedon Dec 3, 2018
I think we should add the missing template head to all those cases (the variant-values
variant_alternative
and pair's and array'stuple_element
.jensmaurer commentedon Dec 20, 2018
But what does it mean?
tuple_element<I, array<T, N>>::type
is not valid C++ either way, iftype
is in fact a typedef: You can't have out-of-line definitions of member typedefs.JohelEGP commentedon Dec 21, 2018
#2476 and https://wg21.link/LWG3166 are related.
tuple_element
specializations #2786jensmaurer commentedon May 3, 2019
Duplicate of #2786.