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.
1 // creates a tree 2 Item root = new Item; 3 root.populate; 4 root[0].populate; 5 root[1].populate; 6 7 int cnt, a; 8 9 // count the population 10 deepIterate!((e) => ++cnt)(root); 11 assert(cnt == 7); 12 13 // previous content is consumed 14 root.populate; 15 root[0].populate; 16 root[1].populate; 17 18 // the delegate result is used to stop the iteration 19 deepIterate!((Item e, ref int p){++p; --cnt; return cnt == 4;})(root, a); 20 assert(cnt == 4); 21 assert(a == 3);
Iterates a tree-like structure that exposes an input range interface and calls each element with a function.