#include #include using namespace boost; using namespace std; struct Foo { void operator()( const char* s_, int l_ ) { s = s_; l = l_; } const char* s; int l; }; struct Bar { Bar( Foo& foo_ ) : foo( foo_ ) { } void operator()( const char* s_ ) { bind(foo, _1, _2)(s_, 42); } Foo& foo; }; int main () { Foo f; Bar b( f ); b( "Hallo" ); cout << f.s << ", " << f.l << endl; }