【发布时间】:2016-06-24 07:50:52
【问题描述】:
与this question 相关 我想知道是否可以使用 boost::hana 以简单的方式实现这样的目标:
#include <boost/hana.hpp>
#include <boost/hana/unpack.hpp>
namespace hana = boost::hana;
template<typename ... T>
struct A {};
int main() {
auto my_tuple = hana::tuple_t<int, double, float>;
// Is there any way to unpack my_tuple as template arguments for A?
// Something like
using MyStruct = A<hana::unpack_types(my_tuple)...>;
static_assert(std::is_same<MyStruct, A<int, double, float>>::value, "Ooops!");
}
【问题讨论】:
标签: c++ boost c++14 boost-hana