Is Nullable supposed to provide Optional semantics?

Jonathan M Davis newsgroup.d at jmdavisprog.com
Sat Dec 30 09:17:50 UTC 2017


On Saturday, December 30, 2017 08:59:40 Chris Paulson-Ellis via Digitalmars-
d-learn wrote:
> On Friday, 29 December 2017 at 22:08:59 UTC, vit wrote:
> >     n = Nullable!Object.init;
> >     assert(n.isNull == true);
> >
> > [...]
> > more:
> > https://forum.dlang.org/thread/jrdedmxnycbqzcprebjl@forum.dlang.org?page
> > =1
> Thanks.
>
> No-one in the linked thread seemed to know why .destroy is used
> in nullify. Looking at the commit history it used to be .clear,
> but maybe that did the same thing, I don't know.

destroy used to be called clear (e.g. that's what TDPL calls it), but it was
renamed, because it was too easily confused with clearing a container and
tended to be misused.

- Jonathan M Davis



More information about the Digitalmars-d-learn mailing list