The OpenD Programming Language

mir_slice.opIndexAssign

Assignment of a value (e.g. a number) to a fully defined index.

  1. void opIndexAssign(Slice!(RIterator, RN, rkind) value, Slices slices)
  2. void opIndexAssign(T[] value, Slices slices)
  3. void opIndexAssign(T concatenation, Slices slices)
  4. void opIndexAssign(T value, Slices slices)
  5. auto ref opIndexAssign(T value, size_t[N] _indices)
    struct mir_slice(Iterator_, size_t N_ = 1, SliceKind kind_ = Contiguous, Labels_...)
    ref return scope @trusted
    static if(isMutable!DeepElement)
    opIndexAssign
    (
    T
    )
    (,
    size_t[N] _indices...
    )
    if (
    0 < N_ &&
    N_ < 255
    &&
    !(
    kind_ == Canonical &&
    N_ == 1
    )
    &&
    Labels_.length <= N_
    &&
    isIterator!Iterator_
    )
  6. auto ref opIndexAssign(DeepElement value, size_t[N] _indices)

Examples

import mir.ndslice.allocation;
auto a = slice!int(2, 3);

a[1, 2] = 3;
assert(a[1, 2] == 3);

Meta