相关疑难解决方法(0)

Boost Hana获取第一个匹配项的索引

所以我正在尝试使用boost::hana一个需要使用功能来基于值获取元素索引的库:

constexpr auto tup = boost::hana::make_tuple(3_c, boost::hana::type_c<bool>);

auto index = get_index_of_first_matching(tup, boost::hana::type_c<bool>);
//   ^^^^^ would be a boost::hana::int_<1>
Run Code Online (Sandbox Code Playgroud)

有没有办法做到这一点?更好的是,它已经存在了hana,我不知道吗?

感谢您的支持!

c++ boost template-meta-programming c++11 boost-hana

3
推荐指数
1
解决办法
605
查看次数