The OpenD Programming Language

mir_slice.first

Accesses the first deep element of the slice.

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

Examples

import mir.ndslice.topology: iota, universal, canonical;
auto f = 5;
assert([2, 3].iota(f).first == f);

Meta