The OpenD Programming Language

mir_slice.last

Accesses the last deep element of the slice.

  1. auto ref last()
    struct mir_slice(Iterator_, size_t N_ = 1, SliceKind kind_ = Contiguous, Labels_...)
    ref @trusted return scope @property
    static if(N > 1)
    last
    ()
    ()
    if (
    0 < N_ &&
    N_ < 255
    &&
    !(
    kind_ == Canonical &&
    N_ == 1
    )
    &&
    Labels_.length <= N_
    &&
    isIterator!Iterator_
    )
  2. auto ref last(T value)

Examples

import mir.ndslice.topology: iota;
auto f = 5;
assert([2, 3].iota(f).last == f + 2 * 3 - 1);

Meta