mir_slice.opIndexOpAssign

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

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

Examples

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

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

Meta