help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ambiguity and 0


From: Paul Pluzhnikov
Subject: Re: ambiguity and 0
Date: Sat, 17 Dec 2005 09:36:44 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

it.damn@gmail.com writes:

> I would like to understand what g++ is doing in the following case a

Following the C++ Language specification ...

> My main question has to be why 0 is treated as void* but any other
> number won't be.

Because the standard says that's what is supposed to happen.

> Is this because 0 is NULL 

No, '0' is definitely not the same thing as 'NULL'.

> and a pointer is basically an unsigned int?

And a pointer is certainly not an unsigned int (on 64-bit machines
they even have different size).

> The second would be why the cast causes an ambiguity but not a.foo(x).

Again, because the standard says so.

The relevant portion of the standard -- 13.3 Overload resolution --
takes about 20 pages, which I am not about to repeat here.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]