Enum std.datetime.PopFirst
Used to indicate whether popFront
should be called immediately upon
creating a range. The idea is that for some functions used to generate a
range for an interval, front
is not necessarily a time point which
would ever be generated by the range. To get the first time point
in the range to match what the function generates, then use
to indicate that the range should have PopFirst.yes
popFront
called on it before the range is returned so that front
is a time point
which the function would generate.
For instance, if the function used to generate a range of time points
generated successive Easters (i.e. you're iterating over all of the Easters
within the interval), the initial date probably isn't an Easter. Using
would tell the function which returned the
range that PopFirst.yes
popFront
was to be called so that front would then be
an Easter - the next one generated by the function (which when
iterating forward would be the Easter following the original front
,
while when iterating backward, it would be the Easter prior to the
original front
). If
were used, then PopFirst.no
front
would
remain the original time point and it would not necessarily be a time point
which would be generated by the range-generating function (which in many
cases is exactly what is desired -
e.g. if iterating over every day starting at the beginning
of the interval).
The enum base type is
.
int
Enum members
Name | Description |
---|---|
no
|
No, don't call popFront() before returning the range. |
yes
|
Yes, call popFront() before returning the range. |
Authors
Jonathan M Davis and Kato Shoichi