unary function to apply on each element of the list.
Yes.each if it has iterated through all the elements in the list, or No.each otherwise.
Complexity: O(n).
import std.typecons : Flag, Yes, No; auto idl = immutable DList!int([1, 2, 3]); static bool foo(int x) { return x > 0; } assert(idl.each!foo == Yes.each);
Eagerly iterate over each element in the list and call fun over each element. This should be used to iterate through const and immutable lists.
Normally, the entire list is iterated. If partial iteration (early stopping) is desired, fun needs to return a value of type std.typecons.Flag!"each" (Yes.each to continue iteration, or No.each to stop).