Templates can take non-type function pointer parameters, but there is a problem if all possible function pointer parameters are accepted, example:
void dummy()
{
If you know the signature of the function you wish to call (and surely you do), can't you do
template<void F()>
void proxy()
{
F();
}
void dummy() {}
int main()
{
proxy<dummy>();
}
A better solution for your particular problem would be to simply take only the function type as a template argument and the item as an ordinary function argument. You can also use type deduction instead of explicitly specifying which argument types are used:
void dummy()
{
}
template <typename FT>
void proxy(FT fp)
{
fp();
}
int main()
{
proxy(fp);
return 0;
}