David Greene wrote:
I'm trying to compile this little program:
#include
#include <iostream>
namespace tester { class Test { public: void do_test(void) { std::cout << "Done!" << std::endl; }; }; };
int main(void) { tester::Test x;
bind(&tester::Test::do_test, &x, _1)();
http://www.boost.org/libs/bind/bind.html#err_num_args tester::Test::do_test takes one argument (the implicit 'this'), you are passing two, &x and _1 (the first input argument). In addition, although this is not relevant for this particular case, http://www.boost.org/libs/bind/bind.html#err_arg_access you are trying to access the first argument with _1 but no such argument exists since you are calling the result of bind with (), i.e. zero arguments. Summary: bind(&tester::Test::do_test, &x)(); or maybe bind(&tester::Test::do_test, _1)( x );
return(0); }