number of dimensions
element type of an element of the multidimensional arrat
the allocator used for getting memory
static array containing the size of each dimension
An N-dimensional array with individual elements of type T.
1 import std.experimental.allocator.mallocator : Mallocator; 2 3 auto mArray = Mallocator.instance.makeMultidimensionalArray!int(2, 3, 6); 4 5 // deallocate when exiting scope 6 scope(exit) 7 { 8 Mallocator.instance.disposeMultidimensionalArray(mArray); 9 } 10 11 assert(mArray.length == 2); 12 foreach (lvl2Array; mArray) 13 { 14 assert(lvl2Array.length == 3); 15 foreach (lvl3Array; lvl2Array) 16 assert(lvl3Array.length == 6); 17 }
Allocates a multidimensional array of elements of type T.