boost-hana

    2热度

    2回答

    让我们假设我们有这样的东西:一个Foo类('FooInterface')的接口和一个包含'FooInterface'派生类的容器类Bar。 现在我转发一个派生类的类型列表('FooOne','FooTwo')到容器类,它将它们的一个实例存储在一个'boost :: hana :: tuple'后面的小型计算('FooTuple')。 现在我怎么用取消引用这个指针来初始化元组元素,取决于'FooLi

    1热度

    1回答

    我叫这里的部分类型是类似的东西: template < template <typename ...> typename Skeleton, template <typename ...> typename WrapperType, typename ... Pölicies > struct MetaStorage { template < typena

    0热度

    1回答

    的扣除之前的代码片段说不是几个段落更多: #include <boost/hana/fwd/eval_if.hpp> #include <boost/hana/core/is_a.hpp> #include <iostream> #include <functional> using namespace boost::ha

    2热度

    1回答

    我想弄清楚如何在编译时使用boost:hana来转换整数常量列表。 我有我的名单: constexpr auto vals = hana::to<hana::tuple_tag>(hana::range_c<int, 0, 3>); 我想申请功能: constexpr auto Pow2(int i) { return 1 << i; } 然而 constexpr auto res = h

    3热度

    1回答

    考虑: #include <iostream> #include <typeinfo> #include <type_traits> #include <cxxabi.h> #include <boost/hana.hpp> namespace hana = boost::hana; struct Person { BOOST_HANA_DEFINE_STRUCT(Pe

    2热度

    2回答

    我有一个boost :: hana :: set类型的集合,并且想要用它创建一个映射,其中的值是bool的。 // I have a hana set: auto my_set = hana::make_set(hana::type_c<int>, hana::type_c<float> ...); // and want to transform it to a map with a gi

    3热度

    2回答

    是否有使用类似的方式: constexpr auto foo = hana::make_tuple(hana::type_c<Foo1>,hana::type_c<Foo2>); 的东西,如:由于与该代码 template < typename ... Ts > struct Final { constexpr Final(Ts && ... args) {} }; han

    1热度

    1回答

    尝试连接Boost Hana编译时字符串会在我的应用程序中出现编译器错误。是否有任何特定的配置选项来激活或标题,需要包括这个工作? 这里是一个例子: #define BOOST_HANA_CONFIG_ENABLE_STRING_UDL #include "boost/hana.hpp" namespace hana = boost::hana; using namespace hana

    1热度

    1回答

    我试图使用hana::second一对访问hana::type ... namespace hana = boost::hana; using namespace hana::literals; struct Key {}; struct Foo {}; int main() { auto test = hana::make_tuple( hana::make_p

    3热度

    1回答

    所以我尝试使用Boost Hana的any_of方法,但与实现中的描述不同,它仍然会在首先满足谓词的元素之后调用元素。这是一个知道的错误? 下面是一个MCVE: #include <iostream> #include <boost/hana.hpp> int main() { auto t = boost::hana::tuple_t<int, double, float>;