Why is it ambiguous to call overloaded ambig(long) and ambig(unsigned long) with an integer literal?
You’re passing an int to this overloaded function. Although human intuition says that ambig(signed long) ought to be preferred because your input is a negative integer (which cannot be represented as such by an unsigned long), the two conversions are in fact equivalent in “precedence” in C++. That is, the conversion int → unsigned long … Read more