Pointers present some special problems for overload resolution.
Say for example,
void f(int* x) { ... }
void f(char* x) { ...}
int main()
{
f(0);
}
What is wrong with calling f(0)? How can I fix the function call for f(0)?
Pointers present some special problems for overload resolution.
Say for example,
void f(int* x) { ... }
void f(char* x) { ...}
int main()
{
f(0);
}
What is wrong with calling f(0)? How can I fix the function call for f(0)?
f((int*) 0)
or f((char *) 0)
But if you find yourself doing this I would take another look at your design.
What is wrong with calling f(0) is the resolution is ambiguous. Both of your overloaded functions take a pointer which in this case can only be resolved via cast.
f((int*)0)
Depending on what you're trying to do here there are other options that are not ambiguous.