00 /* Two standard conversions (at same level), one user-defined conversion at a lower level. */00 
01 /* One function not matching at all.                                                       */
02 
03 #include <iostream>
04 #include <string>
05 
06 using namespace std;
07 
08 struct Point
09 {
10    double x, y;
11 
12    Point() : x(0.0), y(0.0) {};
13    Point(double d) : x(d), y(0.0) {};
14    Point(double d, double e) : x(d), y(e) {};
15 };
16 
17 
18 void f(Point p){                    // Match at lower level
19   cout << "f(Point)" << endl;
20 }
21 
22 void f(char *c){                    // No match
23   cout << "f(char *)" << endl;
24 }
25 
26 void f(char c){                     // Match - standard conversion
27   cout << "f(char)" << endl;
28 }
29 
30 void f(float c){                    // Match - standard conversion
31   cout << "f(float)" << endl;
32 }
33 
34 int main()
35 {
36   double c = 5.5;
37   f(c);                // error: call of overloaded  f(double&)  is ambiguous
38                        // note: candidates are: void f(Point)
39                        // note:                 void f(char)
40                        // note:                 void f(float)
41 }
42