The OpenD Programming Language

uninitializedFillDefault

nothrow @nogc
T[]
uninitializedFillDefault
(
T
)
(
return scope T[] array
)

Examples

static struct S { int x = 42; @disable this(this); }

int[5] expected = [42, 42, 42, 42, 42];
S[5] arr = void;
uninitializedFillDefault(arr);
assert((cast(int*) arr.ptr)[0 .. arr.length] == expected);
int[] a = [1, 2, 4];
uninitializedFillDefault(a);
assert(a == [0, 0, 0]);

Meta