samedi 20 janvier 2018

Converting variadic template to variadic function

I have a function:

void foo1(SomeEnum&& arg, void(*f)(...));

Which should be called by:

template<SomeEnum Type>
void foo2(fn_type<Type> f) {
    foo1(f);
}

Where fn_type means void(*)(ARGS), and ARGS vary depending on SomeEnum

I need foo2 to be a template as it's the same function as the one in this quiestion.

It's throwing errors of kind: 'void foo1(SomeEnum &&,void (__cdecl *)(...))': cannot convert argument 2 from 'void (__cdecl *)(unsigned int,unsigned int)' to 'void (__cdecl *)(...)

What should I do to call foo1 from foo2 ?

Aucun commentaire:

Enregistrer un commentaire