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, fun)

Functions

lightConst
auto lightConst()
lightImmutable
auto lightImmutable()

Variables

_iterator
Iterator _iterator;
_stride
ptrdiff_t _stride;

Examples

IotaIterator!int iota;
StrideIterator!(IotaIterator!int) stride;
stride._stride = -3;

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);

iota = IotaIterator!int(3);
stride = StrideIterator!(IotaIterator!int)(3, iota);
assert(*stride == *iota);

Meta