A rectangular array is really just one array, is it not? From a syntax
point it looks like a multidimensional array but really it's just a
single linear piece of memory, so just cast it:

void main()
{
    int[2][4] table;
    table[0][] = 0;
    table[1][] = 1;
    table[2][] = 2;
    table[3][] = 3;
    auto x = cast(int[])table;
    assert(x == [0, 0, 1, 1, 2, 2, 3, 3]);
}

Reply via email to