从模板参数包创建 hana::set
Creating a hana::set from template parameter pack
我正在努力弄清楚如何从模板参数包中制作 hana::set。我有一个用于元组的方法 (tuple_t),但它似乎创建了一个我必须使用的集合 make_set。这是我卡住的地方:
template<typename ...Ts>
class Foo
{
public:
static constexpr auto asTuple = hana::tuple_t<Ts...>;
static constexpr auto asSet = hana::make_set(/*what goes here?*/);
};
谢谢
您必须使用 hana::type_c
助手扩展类型:
static constexpr auto asSet = hana::make_set(hana::type_c<Ts>...);
我正在努力弄清楚如何从模板参数包中制作 hana::set。我有一个用于元组的方法 (tuple_t),但它似乎创建了一个我必须使用的集合 make_set。这是我卡住的地方:
template<typename ...Ts>
class Foo
{
public:
static constexpr auto asTuple = hana::tuple_t<Ts...>;
static constexpr auto asSet = hana::make_set(/*what goes here?*/);
};
谢谢
您必须使用 hana::type_c
助手扩展类型:
static constexpr auto asSet = hana::make_set(hana::type_c<Ts>...);