Boost logo

Boost :

From: Jason Hise (chaos_at_[hidden])
Date: 2005-01-21 12:03:48


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk