Cast a 2d static array to a 1d static array. T[s][r] -> T[s*r]

Jonathan JonathanILevi at gmail.com
Tue Feb 27 22:13:05 UTC 2018


Is it possible to cast a 2d static length array to a 1d static 
length array?

E.g.
int[2][2] a = [[1,2],[3,4]];
int[4]    b = cast(int[4])a;

Is not the byte data in memory exactly the same?


More information about the Digitalmars-d-learn mailing list