
21 Jan
2005
21 Jan
'05
5:03 p.m.
Angus Leeming wrote:
You still can't prevent your uses from writing code that results in the problems that led you to try and write this space age solution in the first place.
void f(int); void f(string *);
f(0); // which function is called?
Doesn't this call f ( int )? I was under the impression from reading a book by Sutter (I forget which) that 0 is first and foremost an int. Thus, f ( 0 ) should call the int version and f ( null ) should call the string * version. This seems very natural and reasonable to me. What is the problem here? -Jason