社区
工具平台和程序库
帖子详情
boost::bind
招RD和QA
2004-02-22 11:42:13
使用boost::bind来创建函数对象,请问怎样才能获得其中的参数类型。
我试过对bind产生的二元对象作如下动作,
typedef typename BinaryFunctor::first_argument_type first_argument;
typedef typename BinaryFunctor::second_argument_type second_argument;
但是编译出错,请问有什么解决方法,有函数对象的adapter吗?
...全文
48
3
打赏
收藏
boost::bind
使用boost::bind来创建函数对象,请问怎样才能获得其中的参数类型。 我试过对bind产生的二元对象作如下动作, typedef typename BinaryFunctor::first_argument_typefirst_argument; typedef typename BinaryFunctor::second_argument_typesecond_argument; 但是编译出错,请问有什么解决方法,有函数对象的adapter吗?
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
c++
boost
bind
其中,`
boost
::
bind
`是
Boost
库中的一个关键组件,用于实现函数对象的绑定,它类似于C++11中的std::
bind
,但在C++98/03标准下非常有用。 `
boost
::
bind
`的主要功能是将函数或成员函数与部分参数预先绑定在一起,形成...
基于
boost
的
bind
与function的消息处理框架
在IT领域,
Boost
库是一个非常重要的C++工具集,它为C++标准库提供了许多扩展功能,其中`
bind
`和`function`是两个非常实用的工具。本文将深入探讨这两个概念以及如何在消息处理框架中使用它们。 首先,让我们了解`...
HelloWorld:Hello World 演示测试项目
你好,世界Hello World 演示测试项目结构体 CB { typedef
boost
::variant<
boost
> ,
boost
::function<void> > ...< str> f(
boost
::
bind
( &CB::fun2, this, _1 ) );callback_["A"] = f ;
boost
::get<
boost
> >(callbac
patrex:括号感知的标记化正则表达式
boost
::
bind
(&Foo::bar,
boost
::ref( *this ), ...) 如您所知,
boost
::
bind
可以使用成员函数的引用和指针,因此可以将所有此类调用简化为
boost
::
bind
(&Foo::bar, this, ...) 我们不希望盲目搜索和替换
boost
::ref
boost
1.34.1安装包
7. **API使用**:
Boost
1.34.1版本包含了许多功能强大的库,如智能指针(smart pointers)、函数对象绑定(function and
bind
)、正则表达式(regex)、多线程(thread)、日期时间(date_time)、文件系统...
工具平台和程序库
24,860
社区成员
27,333
社区内容
发帖
与我相关
我的任务
工具平台和程序库
C/C++ 工具平台和程序库
复制链接
扫一扫
分享
社区描述
C/C++ 工具平台和程序库
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章