$1 $2
Row::updatePair(int, long long) // #1
Row::updatePair(int, long double) // #2
// updatePair(924, 0.0);
// int -> int (#1) // $1#1
// int -> int (#2) // $1#2
//
// double -> long long // $2#1
// double -> long double // $2#2
In this case, both conversions in the first group are exact matches, while both conversions in the second group are conversions. They are equally ranked - it's like int -> long
vs int -> double
. The other call has the same types, just different values, so it exhibits the same behavior.
Only float -> double
is a promotion, like only integer types smaller than int to int (and for some exotic platforms to unsigned int) are promotions. So the following wouldn't be ambiguous
$1 $2
Row::updatePair(int, double) // #1
Row::updatePair(int, long double) // #2
// updatePair(924, 0.0f);
// int -> int (#1) // $1#1
// int -> int (#2) // $1#2
//
// float -> double // $2#1 (promotion - not a ranked as conversion).
// float -> long double // $2#2
In that case, the second argument has a better conversion sequence when converted to the parameter of #1
.