Perform argument substitution on nested boost::bind without composition
Suppose I have a function which takes a nullary functor as an argument: void enqueue( boost::function<void()> & functor ); I have another function which takes an int and does something internally: void foo( int a); I would like to nest, but not compose, these together so that I get a functor with the signature: boost::function<void(int)> functor Which when called with a value - say 4 - performs the following: enqueue( boost::bind(&foo, 4) ) My first attempt was the following: boost::function<void(int)> functor = boost::bind(&enqueue, boost::bind(&foo,_1)) This fails because bind performs