An iterator, a pointer, or an array.
A list of lengths for each dimension
n-dimensional slice
Random access range primitives for slices over user defined types
struct MyIota { //`[index]` operator overloading auto opIndex(size_t index) @safe nothrow { return index; } auto lightConst()() const @property { return MyIota(); } auto lightImmutable()() immutable @property { return MyIota(); } } import mir.ndslice.iterator: FieldIterator; alias Iterator = FieldIterator!MyIota; alias S = Slice!(Iterator, 2); import std.range.primitives; static assert(hasLength!S); static assert(hasSlicing!S); static assert(isRandomAccessRange!S); auto slice = Iterator().sliced(20, 10); assert(slice[1, 2] == 12); auto sCopy = slice.save; assert(slice[1, 2] == 12);
Creates an n-dimensional slice-shell over an iterator.