4 #ifndef MakeDerivedVariant_h
5 #define MakeDerivedVariant_h
10 static T lvalue(T &&
a) {
return a;}
13 template <
class T,
typename...Args>
14 constexpr
auto extend(
const std::variant<Args...> &,
const T &) -> std::variant<
Args..., T> {
20 template <
typename TypeHelper,
typename VariantType, std::
size_t N = std::variant_size_v<VariantType> >
22 using variant_type = decltype( extend(MakeVariant<TypeHelper, VariantType, N-1>::m_val,
28 template<
typename TypeHelper,
typename VariantType>
29 struct MakeVariant<TypeHelper, VariantType,1> {
30 using variant_type = std::variant< typename TypeHelper::template type< decltype( lvalue( std::get<0>(VariantType{}))) > > ;