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