Lecture 3 - Slide 9 : 27
Function Overloading - Examples
We show examples of single best match and ambiguous function overloading
Exact matches - a trivial example.
Simple examle of an ambiguity.
An ambiguity between 'float to int' and 'float to long int'.
'Float to double' conversion prefered over 'float to int' and 'float to long int'.
Point.h.
double to Point via Point(double) constructor.
'double to char' instead of 'double to Point'.
Now in an ambiguity situation.
A single best match again - slightly surprising perhaps.
A trivial example with overloading of a function of two parameters.