Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-02-12 18:22:10


Douglas Gregor wrote:
> On Thursday 12 February 2004 05:22 pm, Peter Dimov wrote:
>> Ralf W. Grosse-Kunstleve wrote:
>>> @@ -209,6 +211,7 @@
>>> // Clears up a warning with GCC 3.2.3
>>> return make_any_pointer(reinterpret_cast<void*>(0));
>>
>> This of course doesn't have anything to do with your patch, but it
>> caught my eye. reinterpret_casting 0 to void* is not guaranteed to
>> yield a null pointer. :-)
>
> Shortly after this message this message hit the Boost list (and
> before I saw it), I received this helpful little note from a friend:
>
> "You might want to arm yourself with 5.2.10/8 and 4.10/1."
>
> He's right, I think. 0 is the null pointer constant, which is a null
> pointer value, which is converted to the null pointer value of the
> destination type.

He is right, but not because of 5.2.10/8. :-) 5.2.10/5 + footnote 64 say you
are home free.

> But if you don't agree, I'm just as happy replacing it with a
> static_cast instead of starting a long discussion.

Your choice. :-)


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