https://d.puremagic.com/issues/show_bug.cgi?id=11828

           Summary: std.typecons.Typedef with two arguments too
           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-12-26 16:35:23 PST ---
In some cases I have to tell apart different Typedefs using the cookie, but I
don't need to specify a different init value:

alias Meters = Typedef!(double, "Meters");
alias Liters = Typedef!(double, "Liters");


For such cases I suggest to replace this part of the std.typecons module:


/**
Library typedef.
 */
template Typedef(T)
{
    alias .Typedef!(T, T.init) Typedef;
}



With two (shorter) aliases:


/// Library typedef.
alias Typedef(T) = .Typedef!(T, T.init);

/// ditto
alias Typedef(T, string cookie=null) = .Typedef!(T, T.init, cookie);

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

Reply via email to