Difference between C++11 std::bind and boost::bind

boost::bind has overloaded relational operators, std::bind does not. boost::bind supports non-default calling conventions, std::bind is not guaranteed to (standard library implementations may offer this as an extension). boost::bind provides a direct mechanism to allow one to prevent eager evaluation of nested bind expressions (boost::protect), std::bind does not. (That said, one can use boost::protect with std::bind … Read more

How to use boost bind with a member function

Use the following instead: boost::function<void (int)> f2( boost::bind( &myclass::fun2, this, _1 ) ); This forwards the first parameter passed to the function object to the function using place-holders – you have to tell Boost.Bind how to handle the parameters. With your expression it would try to interpret it as a member function taking no arguments. … Read more