How to check if something can be null

Adam D Ruppe destructionator at gmail.com
Fri Jul 1 15:35:00 UTC 2022


On Friday, 1 July 2022 at 13:48:25 UTC, Antonio wrote:
> I has been using this pattern each time something needs special 
> treatment when it can be null:

i'd prolly check `static if(is(typeof(null) : T))` which means if 
the null literal implicitly converts to type T.

there's also the bludgeon __traits(compiles, v is null) too lol




More information about the Digitalmars-d-learn mailing list