RetroRange

Reverses order of iteration for all dimensions.

Members

Aliases

opDollar
alias opDollar = length
Undocumented in source.

Functions

moveBack
auto moveBack()
Undocumented in source. Be warned that the author may not have intended to support it.
moveFront
auto moveFront()
Undocumented in source. Be warned that the author may not have intended to support it.
popBack
void popBack()
Undocumented in source. Be warned that the author may not have intended to support it.
popFront
void popFront()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

back
auto ref back [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
back
ForeachType!R back [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
empty
bool empty [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
front
auto ref front [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
front
ForeachType!R front [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
length
auto length [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
save
auto save [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

_source
Range _source;

Return Value

Slice/range with reversed order of iteration for all dimensions.

Examples

auto slice = iota(2, 3);
static immutable reversed = [[5, 4, 3], [2, 1, 0]];
assert(slice.retro == reversed);
assert(slice.canonical.retro == reversed);
assert(slice.universal.retro == reversed);

static assert(is(typeof(slice.retro.retro) == typeof(slice)));
static assert(is(typeof(slice.canonical.retro.retro) == typeof(slice.canonical)));
static assert(is(typeof(slice.universal.retro) == typeof(slice.universal)));

Ranges

import mir.algorithm.iteration: equal;
import std.range: std_iota = iota;

assert(std_iota(4).retro.equal(iota(4).retro));
static assert(is(typeof(std_iota(4).retro.retro) == typeof(std_iota(4))));

See Also

Meta