Some array casts

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jan 21 06:55:17 PST 2015


Baz:

>     int[3] m = cast(int[3])[1, 2, 3];
>     writeln(m.sizeof);
>     writeln([1, 2, 3].sizeof);

The sizeof values aren't relevant for D array casts. What matters 
are the array "contents".

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list