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

           Summary: Cannot directly subtype a type tuple
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Andrej Mitrovic <[email protected]> 2013-04-01 
23:54:21 PDT ---
struct Tuple(Types...)
{
    // Error: Types is not a member of Tuple
    alias Types this;

    // ok: workaround
    alias TypeTuple = Types;
    alias TypeTuple this;
}

void main()
{
    alias T = Tuple!int;
}

A light-weight implementation of a Tuple:

struct Tuple(Types...)
{
    alias TypeTuple = Types;
    alias TypeTuple this;
}

alias Tuple!
(
     int
    ,Tuple!(float, string)
) list;

void main()
{
    pragma(msg, list[0]);
    pragma(msg, list[1]);
    pragma(msg, list[1][0]);
    pragma(msg, list[1][1]);
}

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

Reply via email to