我有一个hana::tuple_t<int, char, double, float>
,我想用它来创建一个hana::tuple<int, char, double, float>
.
我认为 usinghana::to<hana::tuple_tag>
会将其转换hana::tuple_t<int, char, double, float>
为hana::tuple<int, char, double, float>
; 但事实并非如此,因为以下总是失败:
auto oType = hana::tuple_t<int, char, double, float>;
BOOST_HANA_CONSTANT_ASSERT(
hana::to<hana::tuple_tag>(oType)
==
hana::make_tuple(1, 'C', 1.0, 1.0f)
);
我也尝试过使用hana::transform
,但没有运气(尽管我怀疑我做错了):
auto vecs = hana::transform(typeList, [](auto t) {
return typename decltype(t)::type{};
});
那么,我该如何将一个 hana::tuple_t 变成一个 hana::tuple?