Is NullableRef checked at compile time?

Levi Maclean via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon May 23 12:38:08 PDT 2016


On Monday, 23 May 2016 at 18:10:14 UTC, 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 checked at compile time only if you "hold the 
door".^^


More information about the Digitalmars-d-learn mailing list