a structure with fields array and slice
import std.experimental.allocator; import std.experimental.allocator.mallocator; auto sl = makeUninitSlice!int(Mallocator.instance, 2, 3, 4); auto ar = sl.field; assert(ar.ptr is sl.iterator); assert(ar.length == 24); assert(sl.elementCount == 24); Mallocator.instance.dispose(ar);
Allocates an uninitialized array through a specified allocator and creates an n-dimensional slice over it. See also std.experimental.allocator.