[Issue 9636] null initialization for std.typecons.Nullable
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Oct 8 03:06:41 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=9636
--- Comment #6 from bearophile_hugs at eml.cc ---
(In reply to monarchdodra from comment #5)
> The original request was the ability to write "myNullable = null". I said
> this should be rejected, because "t = null" could actually be a "non-null
> operation".
>
> I suggested instead using a "null-token" as a "workaround", but, as
> JakobOvrum states, "why all this?"
>
> Is there something we actually *get* from this, or is it only sugar? If it's
> only sugar, i suggest we close. How do we close an enhancement? Won't Fix?
> Invalid?
Do you mean I should write code like this?
void foo(Nullable!(immutable int[4]) items = Nullable!(immutable int[4]).init)
{}
I find it not acceptable and I'd like some shorter way to write it.
--
More information about the Digitalmars-d-bugs
mailing list