cast from void[] to ubyte[] in ctfe

Don Clugston dac at nospam.com
Fri Jul 13 02:53:07 PDT 2012


On 13/07/12 11:16, Johannes Pfau wrote:
> Casting from void[] to ubyte[] is currently not allowed in CTFE. Is
> there a special reason for this? I don't see how this cast can be
> dangerous?

CTFE doesn't allow ANY form of reinterpret cast, apart from 
signed<->unsigned. In particular, you can't do anything in CTFE which 
exposes endianness.

It might let you cast from ubyte[] to void[] and then back to ubyte[] or 
byte[], but that would be all.


More information about the Digitalmars-d-learn mailing list