9 Jun
2015
9 Jun
'15
7:57 a.m.
While a constexpr variant is a very useful utility its scope for
meta-programming is limited.
IIRC a constexpr variant can only hold types that are
trivially_destructible (a recursive union with an user-defined destructor
is not constexpr). To allow mutation the types it holds must be
trivially_constructible, and trivially_copy_constructible/assignable. These
requirements are pretty strict.
Given such a variant type, variant