D equivalent of C++ reinterpret cast?

bearophile bearophileHUGS at lycos.com
Sun Sep 19 17:07:38 PDT 2010


orgoton baberek:
> Use a union, which is the correct and safe way.

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.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list