On Fri, Feb 29, 2008 at 6:08 AM, QbProg
[snip]
function
FunctionOne; function < bool (int ) > FunctionTwo; class Implementor { public: void ImplOne ( int , int ); bool ImplTwo ( int ); };
void test () { Implementor i;
FunctionOne = bind ( &Implementor::ImplOne , &i , _1 , _ 2); FunctionTwo = bind (&Implemenetor::ImplTwo, &i , _1);
/* I Would be nice to do something like this, with parameter "guessing" */ // FunctionOne = GenericBind ( &Implementor::ImplOne ,&i); // FunctionTwo = GenericBind ( &Implementor::ImplTwo, &i);
/* This will greatly remove verbosity! */ /* Actually I do */ #define Bind0(A,B) bind(A,B) #define Bind1(A,B) bind(A,B,_1) #define Bind2(A,B) bind(A,B,_1,_2) ...... FunctionOne = Bind2 ( &Implementor::ImplOne , &i ); FunctionTwo = Bind1 ( &Implementor::ImplTwo , &i); }
It would be usefoul to make library callbacks more usable, insteat of writing a long list of arguments each time. It is possible with current implementation?
I have something in the dataflow library that I am planning to take in
the direction you're suggesting. The current syntax allows something
like this:
FunctionOne = make_slot_selector