Consider:
typedef boost::variant<T0, ..., TN> variant_T_t;
typedef boost::variant<U0, ..., UN> variant_U_t;
...
typedef boost::variant<variant_T_t, variant_U_t, ...> variant_t;
This extends the limit on the number of types that can be held by my type to pow(BOOST_VARIANT_LIMIT_TYPES, L)
, where L
is the number of levels nested.
Is this (to an extent) an acceptable solution, or is it just a bad hack? Is there a better solution out there? Perhaps the old-fashioned union
is more appropriate?