The OpenD Programming Language

StrideIterator

Iterates an iterator with a fixed strides.

StrideIterator is used by stride.

Members

Aliases

__map
alias __map(alias fun) = StrideIterator__map!(Iterator, _stride, fun)

Functions

lightConst
auto lightConst()
lightImmutable
auto lightImmutable()

Manifest constants

_stride
enum _stride;

Variables

_iterator
Iterator _iterator;

Examples

IotaIterator!int iota;
StrideIterator!(IotaIterator!int, -3) stride;

iota -= stride._stride;
--stride;
assert(*stride == *iota);

iota += stride._stride;
++stride;
assert(*stride == *iota);

assert(stride[7] == iota[7 * stride._stride]);

iota -= 100 * stride._stride;
stride -= 100;
assert(*stride == *iota);

iota += 100 * stride._stride;
stride += 100;
assert(*stride == *iota);

assert(*(stride + 10) == *(iota + 10 * stride._stride));

assert(stride - 1 < stride);

assert((stride - 5) - stride == -5);

Meta