t { int i; static assert(is(typeof(asFlatStaticArray(i)) == int[1])); asFlatStaticArray(i)[] = 5; assert(i == 5); int[1][2][3] mdimSArr; static assert(is(typeof(asFlatStaticArray(mdimSArr)) == int[6])); asFlatStaticArray(mdimSArr) = [1, 2, 3, 4, 5, 6]; assert(mdimSArr == [[[1], [2]], [[3], [4]], [[5], [6]]]); static assert(is(typeof(asFlatStaticArray!2(mdimSArr)) == int[1][6])); assert(asFlatStaticArray!2(mdimSArr) == [[1], [2], [3], [4], [5], [6]]
Represents value as a flat (single-dimension) static array. Considers T to be an n-dimensional static array type.
See also $(DPREF traits, MultidimStaticArrayElementType), $(DPREF traits, multidimStaticArrayElementCount).