Function fill

Fills range with value.

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

Parameters

NameDescription
Range Input range type.
Value Filler type.
range Input range.
value Filler.

Example

import tanya.algorithm.comparison : equal;

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

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