Rotator

Range that rotate elements.

  1. Rotator!Range rotator(Range r)
  2. struct Rotator(Range)
    struct Rotator (
    Range
    ) if (
    isForwardRange!Range &&
    hasLength!Range
    ) {
    size_t cnt;
    Range start;
    Range now;
    }

Postblit

A postblit is present on this object, but not explicitly documented in the source.

Examples

1 import std.algorithm : equal, cmp;
2 import std.array : array;
3 int[] a = [1, 2, 3];
4 assert(equal!equal(a.rotator, [
5     [1, 2, 3],
6     [2, 3, 1],
7     [3, 1, 2],
8 ]));
9 int[] b = [3, 1, 4, 1, 5];
10 assert(equal(b.rotator.maximum!"cmp(a, b) == -1", [5, 3, 1, 4, 1]));

Meta