Struct std.datetime.NegInfIntervalRange
A range over a
. It is an infinite range.
NegInfInterval
is only ever constructed by NegInfIntervalRange
.
However, when it is constructed, it is given a function, NegInfInterval
, 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 func
interval
, pass a function to
NegInfInterval
!Date
's NegInfInterval
bwdRange
where that function took a Date
and
returned a Date
which was one day earlier. That function would then be
used by
's NegInfIntervalRange
to iterate over the
Dates in the popFront
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 negative infinity, the range is always iterated over
backwards, never forwards.
must generate a time point going in
the proper direction of iteration, or a func
DateTimeException
will be
thrown. So, the time points that
generates must be earlier in time
than the one passed to it. If it's either identical or later in time, then a
func
DateTimeException
will be thrown.
Also note that while normally the end
of an interval
is excluded from
it,
treats it as if it were included. This allows
for the same behavior as with NegInfIntervalRange
. This works
because none of PosInfIntervalRange
's functions which care about whether
NegInfInterval
end
is included or excluded are ever called by
. NegInfIntervalRange
returns a normal interval
interval
, so any
functions which are called on it which care about
whether NegInfInterval
end
is included or excluded will treat end
as excluded.
Properties
Name | Type | Description |
---|---|---|
front
[get]
|
TP |
The first time point in the range. |
func
[get]
|
TP delegate(in TP) |
The function used to generate the next time point in the range. |
interval
[get]
|
NegInfInterval!TP |
The interval that this range currently covers.
|
save
[get]
|
NegInfIntervalRange |
Returns a copy of this .
|
Methods
Name | Description |
---|---|
opAssign
|
|
popFront
|
Pops from the range, using to generate the next
time point in the range.
|
Authors
Jonathan M Davis and Kato Shoichi