
11 May
2010
11 May
'10
3:08 p.m.
I have 2 functions like:
struct obj {
void foo() { };
void bar() { };
}
How would I store this in a variable ... so that I can call the function via the variable later...
using boost::function; using boost::bind; obj o; // NOTE that "o" will be copied function<void()> callFoo = bind(&obj::foo, o), callBar = bind(&obj::bar, o); callFoo(); callBar();