The OpenD Programming Language

RetroIterator

Reverse directions for an iterator.

RetroIterator is used by retro.

Members

Aliases

__map
alias __map(alias fun) = RetroIterator__map!(Iterator, fun)

Functions

lightConst
auto lightConst()
lightImmutable
auto lightImmutable()

Variables

_iterator
Iterator _iterator;

Examples

IotaIterator!int iota;
RetroIterator!(IotaIterator!int) retro;

++iota;
--retro;
assert(*retro == *iota);

--iota;
++retro;
assert(*retro == *iota);

assert(retro[-7] == iota[7]);

iota += 100;
retro -= 100;
assert(*retro == *iota);

iota -= 100;
retro += 100;
assert(*retro == *iota);

assert(*(retro + 10) == *(iota - 10));

assert(retro - 1 < retro);

assert((retro - 5) - retro == -5);

iota = IotaIterator!int(3);
retro = RetroIterator!(IotaIterator!int)(iota);
assert(*retro == *iota);

Meta