Make a function has higher precedence than another

  ambiguous, c++, c++11, function

So I have a function:

void foo(char a = 'A', int b = 0)
{
    // code
}

And I have another one:

void foo(int b = 0, char a = 'A')
{
    //code
}

Then if I call foo(), it will return an error because the compiler can’t decide which function to call. So can I make a function that has higher precedence than another? So if I call foo() then the compiler which one to choose?

Source: Windows Questions C++

LEAVE A COMMENT