http://d.puremagic.com/issues/show_bug.cgi?id=9636

           Summary: null initialization for std.typecons.Nullable
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from [email protected] 2013-03-02 12:43:34 PST ---
Currently if I want a Nullable function argument initialized to null I have to
use:

import std.typecons: Nullable;
void foo(Nullable!(immutable int[4]) items = Nullable!(immutable int[4]).init)
{}
void main() {}


Or with a global helper alias:

import std.typecons: Nullable;
alias NullableItems = Nullable!(immutable int[4]);
void foo(NullableItems items = NullableItems.init) {}
void main() {}


But maybe there is a way to modify std.typecons.Nullable so this simpler code
is accepted (or something equally simple):

import std.typecons: Nullable;
void foo(Nullable!(immutable int[4]) items = null) {}
void main() {}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to