In the documentation one can learn how to do array operations with 1D arrays. However, this does not scale up for 2D arrays. For example, the following does not work:

int[2][2] a,b;
a = [[1,1],[1,1]];
b[][] = a[][]*2;


Additionally, I would like to assign 2D sub-arrays of a 3D array, i.e. something like the following:

int[3][2][2] a;

a[0] = [[2,2], [2,2]];


I did not understand how to use std.experimental.ndslice to do this. An example would be greatly appreciated.

Reply via email to