initializing const(Date)

cal callumenator at gmail.com
Tue Mar 19 10:04:00 PDT 2013


On Tuesday, 19 March 2013 at 16:35:22 UTC, Dan wrote:
> This used to work but now in 2.062 it causes ctfe error.
> Any suggested workaround?

This seems to work:

Date defDate() pure { return Date(1929, 10, 29); }
const(Date) DefaultDate = defDate();

Assuming you wanted to avoid a initializing inside a static 
this().


More information about the Digitalmars-d-learn mailing list