I have been asked the following example to fix without modifying both function declaration and call.
void Display(int *nData)
{
}
void Display(float *fData)
{
}
int main()
{
int a = 5;
float b = 4.0f;
Display(&a);
Display(&b);
Display(nullptr or NULL); // Ambiguity here, as nullptr or NULL (0) can be converted implicitly by compiler to both int and float
return 0;
}
Any ideas ? Thanks
EDIT: Thanks for answers to fix this using std::nullptr_t with an overload, but what if the argument is "NULL" instead of nullptr ? How to fix that ?