I have my function overloaded in code below:
void function(char x, double y) {
cout << "char, double" << endl;
}
void function(int x, int y) {
cout << "int, int" << endl;
}
int main() {
function('a', 'b');
return 0;
}
When i try to compile it says me: "[Warning] ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second"
How does compiler make implicit conversions here so that it's ambiguous which candidate is right?