Improvements to std.typecons.Nullable

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Tue Oct 8 20:42:45 PDT 2013


On Tue, 08 Oct 2013 22:55:34 +0200
"monarch_dodra" <monarchdodra at gmail.com> wrote:
> 
> A Nullable!T isn't a T. It's a T handler.

I see that as an (unavoidable) implementation detail.

> "alias this" allows implicit cast, which should 
> only happen with a "is a" relation. Using it in a different 
> context (such as nullable) is wrong, and these errors are the 
> price we are paying for it. It's a bit more verbose, but it would 
> solve *all* of these ambiguity and unexpected error problems.
> 
> I would much rather we push in that direction instead.
> 
> This also holds true for RefCounted btw.
> 
> That's my take on it.

Personally, I find Nullable's "alias this" functionality to be a
wonderful convenience. FWIW.


More information about the Digitalmars-d mailing list