10 Jan
2006
10 Jan
'06
3:44 p.m.
Peter Dimov wrote:
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).
Aha! Ok, so it was a fundamental misunderstanding of the bind mechanism itself. For some reason I had it in my head that _1 indicated which argument that &x should be bound to. -Dave