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