bind1st/bind2nd与mem_fun组合使用的问题
2012-03-18 16:44
393 查看
像
[/code]
这种把bind1st/bind2nd与mem_fun等组合使用编译通不过的解决方法:
std::bind1st and std::bind2nd don't accept functors which take reference arguments, because they themselves form references to these arguments. You can
use pointers for your function inputs instead of references
use boost::bind
accept the performance cost of copying the string
是因为
The issue is a defect in the library specification.
Take a look at this bug report against gcc and the resulting discussion: Bug 37811 - bind1st fails on mem_fun with reference argument
C++03 lacked the facilities to build a perfect bind library. This issue is fixed in C++11 with perfect forwarding and std::bind.
[code]bind1st(mem_fun1<void, queue<char>, const char &>(&queue<char>::push), &queIndexes);
[/code]
这种把bind1st/bind2nd与mem_fun等组合使用编译通不过的解决方法:
std::bind1st and std::bind2nd don't accept functors which take reference arguments, because they themselves form references to these arguments. You can
use pointers for your function inputs instead of references
use boost::bind
accept the performance cost of copying the string
是因为
The issue is a defect in the library specification.
Take a look at this bug report against gcc and the resulting discussion: Bug 37811 - bind1st fails on mem_fun with reference argument
C++03 lacked the facilities to build a perfect bind library. This issue is fixed in C++11 with perfect forwarding and std::bind.
相关文章推荐
- mem_fun和boost::Bind使用
- 关于for_each,mem_fun和bind1st在类内部组合使用的心得
- python字典对与list对象组合使用小问题
- 学习使用mem_fun、mem_fun_ref函数
- marvell 上os_mem_alloc的使用问题
- 关于navigationViewController与tabViewController组合使用的问题
- STL中仿函数(functors)、类成员和mem_fun的使用
- STL的bind1st,bind2nd,mem_fun,mem_fun_ref使用示例
- 使用call、apply和bind解决js中烦人的this,事件绑定时的this和传参问题
- android开发(35) fragment和actionbar组合使用。解决不触发onOptionsItemSelected的问题,获得actionbar 的默认 get icon
- STL中仿函数(functors)、类成员和mem_fun的使用
- 小程序 view使用bindtap传值问题
- mem_fun的使用
- C/C++ 使用rand()组合形式生成大于15位的随机数时存在的问题
- ndnSIM 2.0 因缺少pythonbind无法使用visual组件问题 —pybindgen (found '') ".. ns3::VisualSimulatorImpl not found"
- [网络通信]使用fork的TCP通信服务端重起bind问题
- mem_fun的用法,以及使用wcout
- 使用递归算法解决字符的组合问题
- JS中的this指向问题以及apply、call、bind的使用
- oracle sql中使用contains函数解决like in %组合使用 的问题