17 using BaseType_ =
typename BaseVariantTraitsType::BaseType;
18 using BaseType = std::conditional_t<IsConst, const BaseType_, BaseType_>;
20 using TupleType =
typename BaseVariantTraitsType::DerivedTypesTuple;
22 using RetType =
typename BaseVariantTraitsType::template ReferenceVariant_const<IsConst>;
24 using RefTupleType =
typename BaseVariantTraitsType::template ReferenceTuple_const<IsConst>;
26 using MyRefType = std::tuple_element_t<Index, RefTupleType>;
34 if constexpr (Index <
sizeof...(DerivedTypes)) {
37 std::in_place_type_t<MyRefType>{},
38 static_cast<std::conditional_t<IsConst, const MyDerivedType, MyDerivedType>&
>(
41 if constexpr (Index + 1 <
sizeof...(DerivedTypes)) {
47 throw std::runtime_error(
"Invalid Input");
50 std::in_place_type_t<FirstRefType>{},
52 std::conditional_t<IsConst, const FirstDerivedType, FirstDerivedType>&
>(value));