所以我正在尝试使用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,我不知道吗?
感谢您的支持!