Current sentiment on Nullable.get

Neia Neutuladh neia at ikeran.org
Sat Dec 15 16:07:47 UTC 2018


On Sat, 15 Dec 2018 09:11:37 +0000, aliak wrote:
> In generic code if I get a Nullable!T* I know I need to check whatever
> get returns is null or not. With any other T which could be a reference
> type it complicates my code.

You use Nullable!(T*) only when you need to distinguish "a null value that 
has been set" from "no value because it has not been set". In generic 
code, this is often when you don't know whether null is a valid value -- 
perhaps you don't even check whether you're dealing with something that can 
be null.


More information about the Digitalmars-d mailing list