[Issue 12103] New: TypeTuple loop variable as template alias argument doesn't work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 7 14:41:35 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12103

           Summary: TypeTuple loop variable as template alias argument
                    doesn't work
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: peter.alexander.au at gmail.com


--- Comment #0 from Peter Alexander <peter.alexander.au at gmail.com> 2014-02-07 14:41:32 PST ---
See this:

template id(alias a) { alias id = a; }

void main() {
    import std.typetuple;
    alias TypeTuple!(() => 0, () => 1) fs;
    foreach (i, f; fs)
        assert(id!f() == i, i.stringof);
}

In both iterations, id!f aliases ()=>0, so the assertion fails on the second
iteration.

Expected behaviour: id!f aliases ()=>1 on the second iteration, and passes the
assertion.

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


More information about the Digitalmars-d-bugs mailing list