Steven Watanabe
boost::function1
is a unary function object. You can't call it with no arguments. What you meant is probably boost::function0<bool>.
Just goes to show that I'm also a newbie in interpreting this kind of compiler error messages. :) The code I posted was an attempt at a testcase for the actual problem I had. Your answer pointed me in the right direction to solve this.
// But replacing one_arg_f by its value fails to compile: // /usr/include/boost/bind.hpp:413: error: invalid use of void // expression boost::bind(&anything::operator(), &something, _1, _2, boost::bind(&anything::one_arg, &something, _1, 80235)) (12345, 67890);
Nested binds are treated specially. The above tries to invoke: something(12345, 67890, something.one_arg(12345, 80235));
Try using protect on the inner bind: boost::protect(boost::bind(&anything::one_arg, &something, _1, 80235)))
I'll keep it in mind. Thanks for your quick and helpful reply. Jeroen.