Allow template parameter of function pointer type to accept functions of any return type
问题 Is there a way to allow a template parameter of function pointer type to accept a function of any (rather than a specific) return type, when the function's return value is not actually used? Here's an MCVE to illustrate what I mean: int returnInt(int) { return 0; } void returnVoid(int) { } template <int (*Func)(int)> struct foo { void bar(int x) { Func(x); } }; int main(int, char *[]) { foo<returnInt> a; // ok foo<returnVoid> b; // argument of type "void (*)(int)" is incompatible // with