jeudi 31 mars 2016

How to call a created functor object as found in another stackoverflow?

In the stackoverflow question Template function that can take lambda or function pointer and deduce arguments for passing to another template there is a functor object created through the CreateFunctor call. How can I use it to invoke doSomething?

int main(){
    auto f1 = CreateFunctor([](int a, int b){doSomething(a, b);}, 1, 2);
    f1(1,2);
}

Does not work.

See http://ift.tt/1PH7nCC as example.

Aucun commentaire:

Enregistrer un commentaire