null if either length was 0 or
allocation failed.
T[] makeArray(T, Allocator)(auto ref Allocator alloc, size_t length)Create an array of T with length elements using alloc. The array is either default-initialized, filled with copies of init, or initialized with values fetched from range.
T | element type of the array being created |
alloc | the allocator used for getting memory |
length | length of the newly created array |
init | element used for filling the array |
range | range used for initializing the array elements |
null if either length was 0 or
allocation failed.
alloc's primitives do. The
overloads that involve copy initialization deallocate memory and propagate the exception if the copy operation throws.
T[] makeArray(T, Allocator)(auto ref Allocator alloc, size_t length, T init)Ditto
Unqual!(ElementEncodingType!R)[] makeArray(Allocator, R)(auto ref Allocator alloc, R range) if (isInputRange!R && !isInfinite!R)Ditto
T[] makeArray(T, Allocator, R)(auto ref Allocator alloc, R range) if (isInputRange!R && !isInfinite!R)Ditto