In D2, I can treat a uint as an array of ubytes by doing this:

uint num = /+...whatever...+/;
ubyte[] = cast(ubyte[4])num;

How do I do that in D1?

IIRC, D1 requires an explicit slice operator to convert from a static-array 
to a slice/dynamic-array, so I tried this:

ubyte[] = (cast(ubyte[4])num)[];

But I get the error:
Error: e2ir: cannot cast num of type uint to type ubyte[4u]


Reply via email to