Re: Is NullableRef checked at compile time?

2016-05-23 Thread ag0aep6g via Digitalmars-d-learn
On 05/23/2016 08:10 PM, cy wrote: I was squinting at the std.typecons.NullableRef code and it _looks_ like isNull is only checked at runtime (and not checked at all in release mode!) but D has surprised me before in its ability to pre-calculate stuff during compilation. NullableRef is little

Re: Is NullableRef checked at compile time?

2016-05-23 Thread Levi Maclean via Digitalmars-d-learn
. [...] NullableRef is checked at compile time only if you "hold the door".^^

Is NullableRef checked at compile time?

2016-05-23 Thread cy via Digitalmars-d-learn
I was squinting at the std.typecons.NullableRef code and it _looks_ like isNull is only checked at runtime (and not checked at all in release mode!) but D has surprised me before in its ability to pre-calculate stuff during compilation. I was thinking of using something like this: