The direction to iterate in. If passing the return value to fwdRange, use Direction.fwd. If passing it to bwdRange, use Direction.bwd.
The duration which separates each successive time point in the range.
import core.time : dur; import std.datetime.date : Date; auto interval = Interval!Date(Date(2010, 9, 2), Date(2010, 9, 27)); auto func = everyDuration!Date(dur!"days"(8)); auto range = interval.fwdRange(func); // Using PopFirst.yes would have made this Date(2010, 9, 10). assert(range.front == Date(2010, 9, 2)); range.popFront(); assert(range.front == Date(2010, 9, 10)); range.popFront(); assert(range.front == Date(2010, 9, 18)); range.popFront(); assert(range.front == Date(2010, 9, 26)); range.popFront(); assert(range.empty);
Range-generating function.
Returns a delegate which returns the next time point which is the given duration later.
Using this delegate allows iteration over successive time points which are apart by the given duration e.g. passing dur!"days"(3) to everyDuration would result in a delegate which could be used to iterate over a range of days which are each 3 days apart.