Array.this

Creates a new $(D_PSYMBOL Array).

Parameters

len size_t

Initial length of the array.

init T

Initial value to fill the array with.

allocator Allocator

Allocator.

Examples

auto v = Array!int([3, 8, 2]);

assert(v.capacity == 3);
assert(v.length == 3);
assert(v[0] == 3 && v[1] == 8 && v[2] == 2);
auto v = Array!int(3, 5);

assert(v.capacity == 3);
assert(v.length == 3);
assert(v[0] == 5 && v[1] == 5 && v[2] == 5);

Meta