Why is SysTime.init invalid?

ed sillymongrel at gmail.com
Mon Mar 31 22:35:28 PDT 2014


OK, lazy me just read the std.satetime article again. It appears 
the design is for no invalid values and it is currently a known 
limitation due to CTFE.

---
d_time_nan	There is no equivalent. SysTime.init, which has a null 
TimeZone object, would be the closest, but once CTFE advances to 
the point that you can new up class objects with it, 
SysTime.init's timezone will be LocalTime, so don't rely on 
SysTime.init being invalid. std.datetime in general tries to 
avoid having any invalid states for any of its types. It's 
intended that creating such values be impossible.
---

I would still like to know if there is a way around this so I can 
have my struct default init.

Thanks,
ed



More information about the Digitalmars-d-learn mailing list