Is there a way to accept any function signature as a parameter? For example:
void accepter(void (*func)(int)) { ... }
would accept anything of type void (*)(int)
. I know I could use a template, such as:
template<class T>
void accepter(T func) { ... }
which would work, but then it allows non-functions to be passed in. How do I filter only for functions in the same way that a void *
filters for any type of pointer?