Date: Tue, 26 Nov 2019 16:49:14 -0800
In the Standard's description of std::variant, there is this line:
"A program that instantiates the definition of variant with no template
arguments is ill-formed."
https://eel.is/c++draft/variant#variant-3
A bit later, regarding the variant(T&&) constructor, there is this:
"Remarks: This function shall not participate in overload resolution unless
- sizeof...(Types) is nonzero,"
https://eel.is/c++draft/variant#ctor-16
Is this a redundant statement? "Types" is std::variant's parameter pack,
so sizeof...(Types) == 0 would've already been ill-formed, not simply a
failed overload.
Looks like an editorial issue to file, but I wanted to ask people here
first.
Melissa
"A program that instantiates the definition of variant with no template
arguments is ill-formed."
https://eel.is/c++draft/variant#variant-3
A bit later, regarding the variant(T&&) constructor, there is this:
"Remarks: This function shall not participate in overload resolution unless
- sizeof...(Types) is nonzero,"
https://eel.is/c++draft/variant#ctor-16
Is this a redundant statement? "Types" is std::variant's parameter pack,
so sizeof...(Types) == 0 would've already been ill-formed, not simply a
failed overload.
Looks like an editorial issue to file, but I wanted to ask people here
first.
Melissa
Received on 2019-11-26 18:51:47