#include #include using namespace boost; using namespace std; struct Foo { Foo() : s( "X" ), l( 11 ) { } 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, 42)(s_); } Foo& foo; }; int main () { Foo f; Bar b( f ); b( "Hallo" ); cout << f.s << ", " << f.l << endl; }