the bidirectional range to iterate backwards
A bidirectional range with length if r also provides a length. Or, if r is a random access range, then the return value will be random access as well.
import std.algorithm.comparison : equal; int[5] a = [ 1, 2, 3, 4, 5 ]; int[5] b = [ 5, 4, 3, 2, 1 ]; assert(equal(retro(a[]), b[])); assert(retro(a[]).source is a[]); assert(retro(retro(a[])) is a[]);
std.algorithm.mutation.reverse for mutating the source range directly.
Iterates a bidirectional range backwards. The original range can be accessed by using the source property. Applying retro twice to the same range yields the original range.