A while back I found that it’s possible to write a C++ function that takes a parameter of function type (not function pointer type!). For example here’s a function that takes a callback function that accepts and returns a double:
void MyFunction(double function(double));
My question is what it means to have a variable of function type, since you can’t declare one in any other context. Semantically, how is it different from a function pointer or reference to a function? Is there an important difference between function pointers and variables of function type that I should be aware of?
Just like
void f(int x[])is the same asvoid f(int* x), the following two are identical:Or, in official language (C++03 8.3.5/3), when determining the type of a function,