boost-mpl

boost-mpl

文章 0 浏览 7

用于可变参数模板向量的 mpl 样式 copy_if 元函数

我有一个元程序,可以与常规的 boost mpl 配合良好。它看起来更像下面这样。 template struct FilterChildrenIfNotOk { typedef typename copy_if

美人如玉 2024-10-10 01:53:22 9 0

使用 boost::mpl 的类型列表的排列

我正在尝试创建一个包含给定类型列表的排列的列表。 当我使用指定的列表而不是通过从实际输入中删除来生成新列表时,下面的代码似乎可以正常工作,但…

少女情怀诗 2024-10-08 23:55:35 9 0

有没有办法将 lambda 的签名推导为 mpl 序列?

有没有办法将 c++0x lambda 的签名、结果和参数类型推导为 Boost.MPL 序列,例如 boost::mpl::vector?例如,对于 lambda, []( float a, int b ) -> …

不必在意 2024-10-08 11:43:24 12 0

将 boost::mpl::list 应用于类型的模板参数

我有一个需要 boost::variant 的类,其中包含指向各种类型的共享指针,如下所示: template class ToyPicker { typedef std::pair< ToySharedPtrVaria…

玩套路吗 2024-10-08 01:47:37 10 0

连接 boost::mpl::string

如何连接 boost::mpl::string? 以下代码产生错误: #include #include #include #include #include #include typedef boost::mpl::vector< boost::mp…

半衾梦 2024-09-30 02:54:15 10 0

在STL容器中存储属性?

假设我有一个名为 generic_pair 的类,其形式为: template struct generic_pair{ K key; V value; }; 现在,问题是我希望能够在 STL 容器中存储一堆…

酸甜透明夹心 2024-09-30 01:08:57 14 0

是否可以在运行时迭代 mpl::vector 而无需实例化向量中的类型?

一般来说,我会使用 boost::mpl::for_each<>() 来遍历 boost::mpl::vector,但这需要一个带有模板的函子函数声明如下: template; void operator()(T&…

℉絮湮 2024-09-29 23:40:02 9 0

C++ - 将类型映射到枚举

可以使编译时 Type ->枚举系列映射? 用一个例子来说明: 比方说,我有一些 Type 和一个枚举值: typedef int Type; enum Enumerated { Enum1, Enum2,…

南巷近海 2024-09-27 10:28:08 10 0

使用 boost::mpl::lambda 基于 static const 成员变量从 boost::mpl::list 中删除类型

我有一个类型列表定义为: typedef boost::mpl::list OriginalList; 我想创建第二个不包含任何水果的列表,即从第一个列表形成的结果列表将包含单个类…

携君以终年 2024-09-07 01:01:22 11 0

如何将 mpl::transform 应用于 mpl::string?

我正在尝试将转换应用于 mpl::string,但无法编译它。我正在使用 MS VC++2010 和 Boost 1.43.0。代码: #include #include #include #include #includ…

嘿哥们儿 2024-09-05 10:31:25 16 0

如何循环访问 boost::mpl::list?

这是我所得到的, #include #include namespace mpl = boost::mpl; class RunAround {}; class HopUpAndDown {}; class Sleep {}; template int doThi…

西瓜 2024-09-01 12:00:29 19 0

c++递归 mpl::equal 问题?

我需要一个 mpl::equal 类似的过程来支持类型递归。 namespace mpl = boost::mpl; BOOST_MPL_ASSERT(( mpl::equal< mpl::vector, typename mpl::push_…

枕梦 2024-08-23 18:32:04 17 0

在 C++ 中对任意长度的类型列表进行模板化;

这是我希望能够输入的内容: class foo : public watchKeys {}; //Or any list of keys Boost::mpl 有序列,允许您执行此操作,但我不想必须这样做: …

北陌 2024-08-22 16:49:41 21 0

如何将 boost::mpl::fold 与 boost::fusion::map 一起使用?

当我尝试编译此文件时: #include #include int main(int argc, char** argv) { typedef boost::fusion::map < boost::fusion::pair, boost::fusion::…

三五鸿雁 2024-08-16 12:31:43 17 0

是否可以使用模板参数的所有组合生成类型?

我有一个模板类 template class S { //... implementations }; 和一些类型 U、V 和 W 的库存类型实现: typedef boost::mpl::vector u_types; typedef…

仅冇旳回忆 2024-08-06 07:09:09 13 0
更多

推荐作者

佚名

文章 0 评论 0

今天

文章 0 评论 0

゛时过境迁

文章 0 评论 0

达拉崩吧

文章 0 评论 0

呆萌少年

文章 0 评论 0

孤者何惧

文章 0 评论 0

更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文