The function called for each element. When its return type is bool, and if it returns true, the iterations are stopped.
The name of the member that gives the real Range.
The iteration mode (breadth-first or depth-first).
The root element.
The variadic parameters passed to Fun (after the element).
True if the iterations have stopped, false otherwise.
// creates a tree Item root = new Item; root.populate; root[0].populate; root[1].populate; int cnt, a; // count the population deepIterate!((e) => ++cnt)(root); assert(cnt == 7); // previous content is consumed root.populate; root[0].populate; root[1].populate; // the delegate result is used to stop the iteration deepIterate!((Item e, ref int p){++p; --cnt; return cnt == 4;})(root, a); assert(cnt == 4); assert(a == 3);
Iterates a tree-like structure that exposes an input range interface and calls each element with a function.