[Issue 6084] New: Impossible to instantiate local template with TypeTuple-foreach iterator variable.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 1 01:18:39 PDT 2011


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: nobody at puremagic.com
        ReportedBy: timon.gehr at gmx.ch


--- Comment #0 from timon.gehr at 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: -------


More information about the Digitalmars-d-bugs mailing list