Ordinary functions have different types only when their signatures differ.
Meaning that these functions both have the same type int(int)
:
int f1(int);
int f2(int);
while this has a different type void(int)
void f3(int);
However, function objects can have different types when their signatures are the same.
Meaning that these two classes are different types (as different classes always are):
class c1 {int operator()(int);};
class c2 {int operator()(int);};
In fact, each functional behavior defined by a function object has its own type.
I don't know exactly what the author means by "functional behaviour", but I think this is just restating that two class types are separate types.
This is a significant improvement for generic programming using templates because you can pass functional behavior as a template parameter
Meaning that you can specify a function class as a template type parameter:
temp<c1> thing_using_c1;
temp<c2> thing_using_c2;
But you can't specify a plain function that way, you'd need to supply the function some other way:
temp<int(int)> thing_using_f1(f1);
temp<int(int)> thing_using_f2(f2);