Exact match
suggest changeAn overload without conversions needed for parameter types or only conversions needed between types that are still considered exact matches is preferred over an overload that requires other conversions in order to call.
void f(int x);
void f(double x);
f(42); // calls f(int)
When an argument binds to a reference to the same type, the match is considered to not require a conversion even if the reference is more cv-qualified.
void f(int& x);
void f(double x);
int x = 42;
f(x); // argument type is int; exact match with int&
void g(const int& x);
void g(int x);
g(x); // ambiguous; both overloads give exact match
For the purposes of overload resolution, the type “array of T” has Exact Match rank with the type “pointer to T”, and the function type T has Exact Match rank with the function pointer type T*, even though both require conversions. These lvalue transformations are ignored when comparing conversion sequences, so an identity conversion is not better than an array-to-pointer or function-to-pointer conversion.
void f(int* p);
void f(void* p);
void g(int* p);
void g(int (&p)[100]);
int a[100];
f(a); // calls f(int*); exact match with array-to-pointer conversion
g(a); // ambiguous; identity is not better than array-to-pointer