boost-hana

    1热度

    1回答

    我正在调查Hana,我很惊讶地看到它有一个type(“排序类型的容器,类似于没有实际值的单元组”的概念),但是types(一系列type)是一个实验性功能。 有谁知道为什么?与单一类型的容器相比,类型列表的复杂性如何?

    4热度

    1回答

    我有一些旧代码使用非常类似于str_const描述的here和here来执行一些constexpr字符串操作。 str_const是Scott Schurr描述的一种文字类型,可以从字符串文字构造,因为它具有const char (&)[]的模板构造函数。 我现在也有一些使用boost::hana的新代码。 我希望能够采取hana::string并创建一个引用它的str_const。最简单的方法是

    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回答

    我想用升压花生成这个最终代码: template < typename ... Ts > void foo(Ts ... data) { constexpr auto tuple = hana::make_tuple(data...); //Code that I need to be generate container_c[tuple[0_c]].foo2(

    2热度

    1回答

    我想知道,不使用典型的递归函数,但使用boost::hana为例,如何用最简单的方式转换工具boost和std工具的一个对象以下类型(例如): std::tuple<int, double, char, double> 到类型的对象: std::tuple<std::pair<int, double>, std::pair<char, double> >; 我一直在寻找的boost::ha

    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热度

    2回答

    我最近下载了最新的boost库以访问的boost ::花与他们的文档page,他们建议使用“FindHana.cmake模块读取将Hana设置为外部项目以供使用。“ 我不知道这一点,所以我刚才设置的编译标志,包括我hana.hpp的头路,但我很想知道如何做到这一点的文档中建议的方式。

    2热度

    3回答

    我想问编译器检查一个元组是否只包含“元类型”。 顺便说一句,我是全新的C++概念。 template < typename T > struct Type { using type = T; }; //! A type can be easily check with a small concept template < typename T > concept bool C

    5热度

    1回答

    考虑以下问题,它使用-std=c++14在Clang 3.8上成功编译。 #include <boost/hana.hpp> namespace hana = boost::hana; int main() { constexpr auto indices = hana::range<unsigned, 0, 3>(); hana::for_each(indices,

    9热度

    2回答

    我需要构建n个类型的元组。这n个类型是n个其他类型的值类型。考虑这个片断: #include <boost/hana.hpp> namespace hana = boost::hana; template<class... Types> class CartesianProduct { public: CartesianProduct(Types... args) : se