uninitializedFill

Fills range with value assuming the elements of the range aren't initialized.

void
uninitializedFill
(
Range
Value
)
(
Range range
,
auto ref Value value
)
if (
isInputRange!Range &&
hasLvalueElements!Range
&&
isAssignable!(ElementType!Range, Value)
)

Parameters

Range

Input range type.

Value

Initializer type.

range Range

Input range.

value Value

Initializer.

Examples

import std.algorithm.comparison : equal;

int[6] actual = void;
const int[6] expected = [1, 1, 1, 1, 1, 1];

uninitializedFill(actual[], 1);
assert(equal(actual[], expected[]));

Meta