Re: Date range iteration

2018-03-12 Thread Jordan Wilson via Digitalmars-d-learn
On Monday, 12 March 2018 at 02:49:34 UTC, Jonathan M Davis wrote: On Monday, March 12, 2018 02:11:49 Jordan Wilson via Digitalmars-d-learn wrote: [...] Maybe iota should be made to work, but as present, it basically wants all three of the types it's given to be the same or implicitly convert

Re: Date range iteration

2018-03-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, March 12, 2018 02:11:49 Jordan Wilson via Digitalmars-d-learn wrote: > I wanted to iterate through a date range, so I initially tried: > iota(Date(2016,1,1),Date(2018,1,1),dur!"days"(1)); > > That wouldn't compile, which is fair enough I guess. Maybe iota should be made to work, but as

Date range iteration

2018-03-11 Thread Jordan Wilson via Digitalmars-d-learn
I wanted to iterate through a date range, so I initially tried: iota(Date(2016,1,1),Date(2018,1,1),dur!"days"(1)); That wouldn't compile, which is fair enough I guess. So I tried a for loop: for (auto i = Date(2016,1,1); i < Date(2018,1,1); i+=dur!"days"(1)){} That seemed to work fine, but I