Templates: generic "return null;"

Dicebot public at dicebot.lv
Mon Feb 3 06:21:28 PST 2014


On Monday, 3 February 2014 at 14:17:11 UTC, Chris wrote:
> Probably. I tried using Nullable, but it caused some problems 
> when the attribute wasn't defined:
>
> core.exception.AssertError@/usr/include/dmd/phobos/std/typecons.d(1233): 
> Called `get' on null Nullable!int.

This is intended. The very point of Nullable is to force you to 
handle `null` state before accessing actual payload.


More information about the Digitalmars-d-learn mailing list