Array.opIndexAssign

Assigns a value to the element with the index pos.

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

Parameters

E

Value type.

value E

Value.

pos size_t

Position.

Return Value

Type: T

Assigned value.

Precondition: length > pos.

Examples

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

Meta