Array.opApplyReverse

Iterating over array via foreach_reverse.

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

Examples

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

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

Meta