#ifndef RFL_INTERNAL_DEFINEVARIANT_HPP_ #define RFL_INTERNAL_DEFINEVARIANT_HPP_ #include namespace rfl { namespace internal { /// Allows you to combine several variants. template struct define_variant; /// Recursive case - both variants. template struct define_variant< std::variant, std::variant, Tail...> { using type = typename define_variant, Tail...>:: type; }; /// Recursive case - variant plus other type. template struct define_variant, Head, Tail...> { using type = typename define_variant, Tail...>::type; }; /// Recursive case - other type. template struct define_variant { using type = typename define_variant, Tail...>::type; }; /// Special case - only a single variant is left. template struct define_variant> { using type = std::variant; }; } // namespace internal } // namespace rfl #endif