dimanche 28 janvier 2018

Using template paramenter pack in function pointer

I want to know how i can use Parameter pack from template as arguments for void function. I try something like this:

template<class... Parametres>
class Function{

void (*function)(Parametres);

}

void Foo(int number){
     //Whatever
}

int main(){

    Function<int> object;

    object.function = Foo;

}

Then you can use the class for calling this function Foo.

Is something like this possible?

Thanks.

Aucun commentaire:

Enregistrer un commentaire