Is the following conversion possible? I've tried boost::lambda and just a plain bind, but I'm struggling to make the conversion in-place without a special helper class that would process foo and invoke bar.
struct Foo {}; // untouchable
struct Bar {}; // untouchable
// my code
Bar ConvertFooToBar(const Foo& foo) { ... }
void ProcessBar(const Bar& bar) { ... }
boost::function<void (const Foo&)> f =
boost::bind(&ProcessBar, ?);
f(Foo()); // ProcessBar is invoked with a converted Bar