Iterates the given array and calls the given callable for each element.
Use this instead of foreach when the array may expand during iteration.
the callable to call for each element
the array to iterate
static immutable expected = [2, 3, 4, 5]; Array!int array; foreach (e ; expected) array.push(e); int[] result; array.each!((e) { result ~= e; }); assert(result == expected);
dmd.dsymbol.foreachDsymbol
See Implementation
Iterates the given array and calls the given callable for each element.
Use this instead of foreach when the array may expand during iteration.