Array.opIndexAssign

Assigns a value to the element with the index pos.

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

Parameters

E

Value type.

value E

Value.

Return Value

Type: Range

Assigned value.

Precondition: length > pos.

Examples

Array!int a = Array!int(1);
a[0] = 5;
assert(a[0] == 5);

Meta