Re: Bind + Function + Arguments
2008-03-01 00:05:29 GMT
On Fri, Feb 29, 2008 at 6:08 AM, QbProg <tholag <at> gmail.com> wrote:
>
> [snip]
>
> function <void (int , int ) > 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)
(Continue reading)
RSS Feed