Boost logo

Boost :

From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2002-10-09 14:03:07


Eric Woodruff wrote:
[...]
> Every reference I can find excludes pointer conversions from being
> implementation defined. ....

Well, the standard aside...

http://groups.google.com/groups?selm=199702071811.KAA20412%40taumet.eng.sun.com
(Subject: Re: reinterpret_cast vs. static_cast, comp.std.c++, 1997/02/10)

http://groups.google.com/groups?selm=7p1tvv%249mv%241%40engnews1.eng.sun.com

"....
>Hmm... you're not saying that
> class A; class B;
> assert(reinterpret_cast<A*>(static_cast<B*>(0)) == static_cast<A*>(0));
>might fail? That is, different data objects can have different null pointer
>representations ...

 Pointers to different objects can in general have different
 sizes and representations. The effects of a reinterpret_cast
 are up to the implemenation. You cannot assume a priori that
 it will or will not change the representation of a pointer.
 ...."

regards,
alexander.


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