Array.opIndexAssign

Assigns a range or a static array.

  1. T opIndexAssign(E value, size_t pos)
  2. Range opIndexAssign(E value)
  3. Range opIndexAssign(T[R] value)
    struct Array(T)
    opIndexAssign
    (
    size_t R
    )
    (
    T[R] value
    )
  4. Range opIndexAssign(Range value)

Parameters

R

Value type.

value T[R]

Value.

Return Value

Type: Range

Assigned value.

Precondition: length == value.length.

Examples

auto v1 = Array!int([12, 1, 7]);

v1[] = 3;
assert(v1[0] == 3);
assert(v1[1] == 3);
assert(v1[2] == 3);

v1[] = [7, 1, 12];
assert(v1[0] == 7);
assert(v1[1] == 1);
assert(v1[2] == 12);

Meta