Create template pack from set of traits
问题 Is it possible (and if so, how) to generate a template pack from a indexed set of type traits so they can be used to instantiate a variant or a tuple? #include <variant> template<int n> struct IntToType; template<> struct IntToType<0> { using type = int; static constexpr char const* name = "int"; // Other compile-time metadata }; template<> struct IntToType<1> { using type = double; static constexpr char const* name = "double"; // Other compile-time metadata }; using MyVariant = std::variant