Array.opApplyReverse - multiple declarations

Function Array.opApplyReverse

Iterating over array via foreach_reverse.

int opApplyReverse (
  scope int delegate(size_t i, ref T) dg
);

Example

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);

Function Array.opApplyReverse

Iterating over array via foreach_reverse.

int opApplyReverse (
  scope int delegate(ref T) dg
);

Example

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);