I'm used to seeing syntax like this for function pointers
int (*pointer_name) (float, char *);
void call_function (void (*)(int), int);
In some C++03 functional libraries I see types used this way:
abc::function<void(*)(int,float)> f;
In C++11's std::function
I see the type given this way
std::function<void(int,float)> f;
There is a missing (*)
. Why?
The C++03 function<T>
has T
being an identical type to the corresponding function pointer. It's easy to imagine the implementation.
std::function
in C++11 is supported by core language enhancements. Have template argument types been extended to accomodate callability?