proposal: add bytesof Property, reduce pointer/cast requires

Lionello Lunesu lio at lunesu.remove.com
Sun Nov 18 00:25:19 PST 2007


The cast to void[] is implicit:

void[] bytesof = (&structvar)[0..1];

and there's no need for the .sizeof if you leave the pointer of type 
struct*.

It also makes sense to make the cast to byte[] NOT implicit, since the 
resulting array might not be portable on a system with different endianess.

L. 





More information about the Digitalmars-d mailing list