3
如何在C ++中创建类型列表的笛卡尔乘积方法?
自我解释。 基本上说我有这样的类型列表: using type_list_1 = type_list<int, somestructA>; using type_list_2 = type_list<somestructB>; using type_list_3 = type_list<double, short>; 它们可以是各种类型的类型列表。 如何获得笛卡尔积的类型列表? result = type_list< type_list<int, somestructB, double>, type_list<int, somestructB, short>, type_list<somestructA, somestructB, double>, type_list<somestructA, somestructB, short> >; 我确实涉足如何创建如下所示的双向笛卡尔乘积:如何创建类型列表的笛卡尔乘积?,但n方法似乎并不那么琐碎。 现在我正在尝试... template <typename...> struct type_list{}; // To concatenate template <typename... Ts, typename... Us> constexpr auto …