www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6474] New: aliasing type tuple elements' members is onerous

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6474

           Summary: aliasing type tuple elements' members is onerous
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: ellery-newcomer utulsa.edu



19:32:04 PDT ---
code like 

struct X(T){
    alias T TT;
}
alias TypeTuple!(int,int, X!string) G;
alias G[2].TT TT; // <-- parse failure

doesn't work. It's just not built in to the D grammar.

Of course, the workaround is simply

alias G[2] G2;
alias G2.TT TT;

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 11 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6474


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs eml.cc



15:28:59 PST ---
*** Issue 5697 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 08 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6474




09:10:37 PST ---
*** Issue 6740 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 10 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6474




13:36:42 PDT ---
Just pasting this here as I've ran into it again:

template test(T, Preds...)
{
    enum bool test = Preds[0]!T;  // error: semicolon expected, not '!'
}

A workaround is to use an alias:

template test(T, Preds...)
{
    alias Pred = Preds[0];
    enum bool test = Pred!T;
}

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