[Issue 4536] New: Typetuples (T...) should have an .init member

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 30 03:05:33 PDT 2010


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

           Summary: Typetuples (T...) should have an .init member
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: philippe.sigaud at gmail.com


--- Comment #0 from Philippe Sigaud <philippe.sigaud at gmail.com> 2010-07-30 12:05:32 CEST ---
Typetuples (T...) should have an .init member. Them not having it is a bother
for generic code.

Say I have a template that takes an alias and a T..., and I want to verify that
the alias is a function accepting T...:

template Test(alias fun ,T...)
if (is(typeof(fun(T.init)))
{...}

This does not work, which I find frustrating.

I have to use this workaround:

template Init(T...)
{
    alias (Tuple!T.init).expand Init;
}

That is, using std.typecons.Tuple as an initiator.

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


More information about the Digitalmars-d-bugs mailing list