Nullable with reference types

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jun 30 04:50:16 PDT 2015


On Tuesday, 30 June 2015 at 00:02:38 UTC, Meta wrote:
> It's a design mistake in Nullable. I would suggest that either 
> never use Nullable with a type that already has a null value, 
> or use the "overload" of Nullable that takes a null value, and 
> set it to null. Example:
>
> Class Test {}
> alias NullableTest = Nullable!(Test, null);

Can we not specialize the other overload for references, 
pointers, and maybe slices?


More information about the Digitalmars-d-learn mailing list