Templates: generic "return null;"

Dicebot public at dicebot.lv
Mon Feb 3 04:25:15 PST 2014


You have forgot to mention what behavior you are actually trying 
to achieve ;) Common not-so-meaningful value is simply T.init , 
but there can be no such thing as generic sentinel.

If you need cheap and simple way to figure out that attribute was 
missing, change API to return value by out parameter and turn 
normal return value into boolean success flag.


More information about the Digitalmars-d-learn mailing list