On Sunday, 29 October 2017 at 16:29:57 UTC, Jonathan M Davis wrote:
valid using ?:, I would think that you'd want to be doing the same check with stuff like if statements anyway. So, it sounds to me like overloading opCast!bool would work just fine.

If you try to do:

some_float ?: 0.0

then it will do nothing as cast(bool)std.math.NaN(0) => true


But that is just one of many possible examples. The elvis operator as proposed does not match on nullity / invalid state.

Reply via email to