The OpenD Programming Language

mir_slice.save

Save primitive.

struct mir_slice(Iterator_, size_t N_ = 1, SliceKind kind_ = Contiguous, Labels_...)
inout @property
save
()
()
if (
0 < N_ &&
N_ < 255
&&
!(
kind_ == Canonical &&
N_ == 1
)
&&
Labels_.length <= N_
&&
isIterator!Iterator_
)

Examples

Save range

import mir.ndslice.topology : iota;
auto slice = iota(2, 3).save;

Pointer type.

import mir.ndslice.allocation;
//sl type is `Slice!(2, int*)`
auto sl = slice!int(2, 3).save;

Meta