D equivalent of C++ reinterpret cast?

Jonathan M Davis jmdavisProg at gmx.com
Sun Sep 19 23:54:24 PDT 2010


On Sunday 19 September 2010 18:19:25 Juanjo Alvarez wrote:
> On Sun, 19 Sep 2010 20:07:38 -0400, bearophile
> 
> <bearophileHUGS at lycos.com> wrote:
> > C standard say that's not safe. You can force that to be safe in
> 
> C-GCC if you explicitly disable a compiler optimization. I think D
> docs don't say anything about this. And Walter has said that
> regarding such things D acts as C. So I am not sure that will be safe
> in future D.
> 
> Unions are not allowed in SafeD, so I guess they are considered
> unsafe in D.

Well, it's not like reintepret_cast is the safest thing either.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list