Addresses of Overloaded Functions


The name of an overloaded function may be used in a number of places other than in a function call. These are:

When a function name has been overloaded, the context in which the name occurs must uniquely identify the function from amongst other functions that overload the name. Consider the following examples.

void f(int);
void f(double);
 
int (*pointerI)(int)    = &f; // address of overloaded function, context selects: void f(int);
int (*pointerD)(double) = &f; // address of overloaded function, context selects: void f(double);
int (*pointerE)(...)    = &f; // Error. No declaration: void f(...); - Not an ambiguity

The following applies.