/* One single best match: user-defined conversion. One match at a lower level. */ /* Two not matching at all. */ #include #include #include "point.h" using namespace std; void f(char *c){ // No match cout << "f(char *)" << endl; } void f(float c){ // Best match - by promotion cout << "f(float)" << endl; } void f(string c){ // No match cout << "f(string)" << endl; } void f(...){ // Match at lower level - ellipsis cout << "f(...)" << endl; } int main(){ Point p(5.5); f(p); // A single best match: f(float) // the conversion operator point -> double, // after a double to float conversion // f(char *) and f(string) do not match at all. // f(...) matches, but it is in a lower matching category }