Consider this code.
struct A {
int i;
};
struct B {
char c;
};
struct C {
double d;
};
void f(A a);
void f(B b);
void f(C c);
void g()
{
f({5});
}
Here I get an ambiguity in f({5});
. But it seems that struct A
's constructor is an exact match for {5}
, while the second one needs an integral promotion, while the last one needs a floating-point conversion.
So why is there an ambiguity?