The OpenD Programming Language

mir_slice.opIndexUnary

Increment ++ and Decrement -- operators for a fully defined index.

  1. auto ref opIndexUnary(size_t[N] _indices)
    struct mir_slice(Iterator_, size_t N_ = 1, SliceKind kind_ = Contiguous, Labels_...)
    ref return scope @trusted
    static if(isMutable!DeepElement)
    opIndexUnary
    (
    string op
    )
    (
    size_t[N] _indices...
    )
    if (
    0 < N_ &&
    N_ < 255
    &&
    !(
    kind_ == Canonical &&
    N_ == 1
    )
    &&
    Labels_.length <= N_
    &&
    isIterator!Iterator_
    )
  2. void opIndexUnary(Slices slices)

Examples

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

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

Meta