PosInfIntervalRange

A range over a PosInfInterval. It is an infinite range.

PosInfIntervalRange is only ever constructed by PosInfInterval. However, when it is constructed, it is given a function, func, which is used to generate the time points which are iterated over. func takes a time point and returns a time point of the same type. For instance, to iterate over all of the days in the interval PosInfInterval!Date, pass a function to PosInfInterval's fwdRange where that function took a std.datetime.date.Date and returned a std.datetime.date.Date which was one day later. That function would then be used by PosInfIntervalRange's popFront to iterate over the std.datetime.date.Dates in the interval - though obviously, since the range is infinite, use a function such as std.range.take with it rather than iterating over all of the dates.

As the interval goes to positive infinity, the range is always iterated over forwards, never backwards. func must generate a time point going in the proper direction of iteration, or a std.datetime.date.DateTimeException will be thrown. So, the time points that func generates must be later in time than the one passed to it. If it's either identical or earlier in time, then a std.datetime.date.DateTimeException will be thrown.

Members

Functions

func
TP delegate(scope const TP) func()

The function used to generate the next time point in the range.

opAssign
PosInfIntervalRange opAssign(PosInfIntervalRange rhs)
popFront
void popFront()

Pops front from the range, using func to generate the next time point in the range.

Properties

front
TP front [@property getter]

The first time point in the range.

interval
PosInfInterval!TP interval [@property getter]

The interval that this range currently covers.

save
PosInfIntervalRange save [@property getter]

Returns a copy of this.

Variables

empty
enum bool empty;

This is an infinite range, so it is never empty.

Meta