I am trying to understand the difference between a "Function Type" and a "Function Pointer" as template parameter and when to apply what. Or, what's the difference?
Simple example:
template <int Function(int)>
struct S1 {
//....
};
template <int (*Function)(int)>
struct S2 {
//....
};
int always42(int) {
return 42;
}
int main() {
S1<always42> s1;
S2<always42> s2;
//....
return 0;
}
Or will the "function type" decay to a "function pointer"?
Can somebody please shed some light on this?