两者有什么区别吗?或者我可以安全地替换每次出现的boost::bind
by std::bind
在我的代码中,从而消除对Boost的依赖?
boost::bind
关系运算符重载 http://www.boost.org/libs/bind/#bind.purpose.overloaded_operators_new_in_boos, std::bind
才不是。
boost::bind
支持非默认调用约定 http://www.boost.org/libs/bind/#bind.implementation.stdcall, std::bind
不保证(标准库实现可能会提供此扩展)。
boost::bind
提供了一种直接机制,允许人们prevent嵌套绑定表达式的热切求值(boost::protect http://www.boost.org/libs/bind/#bind.purpose.using_nested_binds_for_function_), std::bind
才不是。 (也就是说,人们可以使用boost::protect
with std::bind
如果他们愿意的话,或者自己简单地重新实现它。)
std::bind
提供了一种直接机制,允许将任何用户定义的函子视为嵌套绑定表达式,以便force热心评价(std::is_bind_expression http://en.cppreference.com/w/cpp/utility/functional/is_bind_expression: [func.bind.isbind]/1, [func.bind.bind]/10),boost::bind
才不是。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)