[Issue 7666] A function to reverse the items of a tuple

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 27 16:54:04 PDT 2012


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



--- Comment #4 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2012-10-27 16:54:02 PDT ---
(In reply to comment #3)
> With field names

Interesting, the last time I saw this syntax:

static if(is(T X : Tuple!A, A...)) alias A Spec;

it was in the templates book
(https://github.com/PhilippeSigaud/D-templates-tutorial), where Philippe
mentions:

<<beg quote
For me, the main limitation is that template tuple parameters are not ac-
cepted. Too bad. See, imagine you use std.typecons.Tuple a lot. At one point,
you need a template to test if something is a Tuple!(T...) for some T which
can be 0 or more types. Though luck, is is a bit of a letdown there, as you
cannot do:

template isTuple(T)
{
    static if (is(T tup == Tuple!(InnerTypes), InnerTypes...))
    {
        enum isTuple = true;
    }
}
end quote>>

Maybe this was a compiler limitation in earlier versions.

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