How to resolve ambiguity of call to overloaded function with literal 0 and pointer
问题 I'm pretty sure this must have been here already, but I didn't find much information on how to solve this kind of problem (without casting on the call): Given two overloads, I want that a call with function with a literal 0 always calls the unsigned int version: void func( unsigned int ) { cout << "unsigned int" << endl; } void func( void * ) { cout << "void *" << endl; } func( 0 ); // error: ambiguous call I understand why this happens, but I don't want to write func( 0u ) or even func(