An ambiguous call is a situation in which the compiler cannot deduce which version of a function or method to use from the given parameter types. This tag should not be confused with the [ambiguity] tag.
An ambiguous call occurs when the parameters can be converted in many ways such that they fit more than one overload of a function. For example:
void f(float f)
{
}
void f(double d)
{
}
Passing an int value to this function will cause an ambiguous call compiler error, because int
can be converted both to float
and to double
while the compiler is not able to choose the overloaded version of function uniquely.