Of course every function has it types,
for example, function
double foo(bar& f, const const baz*)
has a type of
function, that accepts reference to bar and constant pointer to baz and return double
It can be written like
double ()(bar&, const baz*)
A pointer to variable of types of that function will have type (variable that can store pointer to that function)
will have type
double (*)(bar&, const baz*)
Or, if you want to typedef
a pointer to functions of that type you can write
typedef double (*func_ptr)(bar&, const baz*)
Again,
func_ptr is a type of pointer to function, that accepts reference to bar and constant pointer to baz and return double
One thing here is that function decays to pointer to function, so you can write
func_ptr f = &foo;
and
func_ptr g = foo;
And it would be the same.
Now imagine, that you have
struct A
{
double goo(bar& f, const const baz*);
};
Now goo
has a type of
function of struct A, that accepts reference to bar and constant pointer to baz and return double
A pointer to this function will have type
double (A::*)(bar&, const baz*)
Note, that it types differs from type of free function foo
. They are not compatible at all.
However, if goo
were static
function, the fact that it belongs to struct A
would be insufficient (as far as member function requires implicit this
argument and static
function does not).