[Issue 10812] Improve Template Pattern Matching

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 12 15:25:37 PDT 2013


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



--- Comment #1 from monkeyworks12 at hotmail.com 2013-08-12 15:25:36 PDT ---
It looks like there is a way to "work around" this:

import std.typecons;

alias Pair = Tuple;

T left(T, U)(Pair!(T, U) t)
{
    return t[0];
}

void main()
{
    //Ok
    auto t = Pair!(int, string)(0, "");
    assert(left(t) == 0);
}

I can't think of a different use-case at the moment that this doesn't cover, so
I'll close this for the time being.

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