[Issue 9929] New: Need 'this' when calling template with expanded tuple

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Apr 13 11:20:57 PDT 2013


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

           Summary: Need 'this' when calling template with expanded tuple
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-04-13 11:20:56 PDT ---
Found when implementing fix for Issue 7666:

import std.typecons;
import std.typetuple;

auto reverse(T)(T t)
    if (isTuple!T)
{
    return tuple(Reverse!(t.expand));  // fail

    auto x = t.expand;  // workaround
    return tuple(Reverse!(x));  // ok
}

void main()
{
    auto tup = tuple(1, "2");
    reverse(tup);
}

-- 
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