Array.opApplyReverse

Iterating over array via foreach_reverse.

  1. int opApplyReverse(int delegate(size_t i, ref T) dg)
  2. int opApplyReverse(int delegate(ref T) dg)
    struct Array(T, size_t chunkSize = 32)
    int
    opApplyReverse
    (
    scope int delegate
    (
    ref T
    )
    dg
    )

Examples

Array!(int,4) arr;
scope(exit) arr.free();

int[] values;
arr.insertBack([1,2,3,4]);
foreach(ref val; arr) {
    values ~= val;
}
assert(values[] == arr.data);

Meta