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

           Summary: Impossible to instantiate local template with
                    TypeTuple-foreach iterator variable.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2011-06-01 01:14:15 PDT ---
The following code is rejected by DMD:

import std.typetuple;
void main(){
    int foo(int x)(){return x;}
    foreach(i;TypeTuple!(0)) foo!(i);
}

Error: template instance cannot use local 'i' as parameter to non-global
template foo(int x)


'i' is only a compile-time constant integral value at the point of
instantiation, therefore there is no reason why this should not work.

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

Reply via email to