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



--- Comment #6 from Andrej Mitrovic <[email protected]> 2013-04-05 
12:16:18 PDT ---
Got something better:

auto reversed(T)(T t)
    if (isTuple!T)
{
    static if (is(T : Tuple!A, A...))
        alias RevTypes = Reverse!A;

    Tuple!RevTypes result;
    auto tup = t.tupleof;
    result.tupleof = Reverse!tup;
    return result;
}

void main()
{
    auto tup = tuple(1, "2");
    assert(tup.reversed == tuple("2", 1));
}

I'll make a pull shortly.

P.S. this is a compile-error: Reverse!(t.tupleof)

Might be worth filing this as a bug.

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

Reply via email to