14 Jul
2015
14 Jul
'15
6:33 p.m.
Larry Evans wrote:
Thanks Peter.
To be explicit:
tuple<> t0;
would be allowed, but:
variant<> v0;
wouldn't compile because there are "zero valid values" in a variant<>?
Yes; you can use the type variant<> but you can't declare a variable of it. N4542 says variant<> A variant without alternatives cannot be constructed; it is otherwise an allowed type. It is easier to allow it than to forbid it. which is consistent with variant being a sum type without an extra empty state (same as boost::variant). For a variant that has an extra empty state, one would expect variant<> to be instantiable and always empty.