Passing several tuples (T...) to templates without expanding them

simendsjo simendsjo at gmail.com
Wed Mar 13 03:34:13 PDT 2013


Say you have a tuple type:
     struct Tuple(T...) {
         alias T Tuple;
     }

and a template
     template t(alias A, alias B) {
         // something something
     }

Given
     alias Tuple!(int, 1) A;
     alias Tuple!(int, 1) B;

Is it possible to send this to template t as follows
     t!(A, B)
without it expanding to
     t!(int, 1, int, 1)
?

This is what I'm trying to achieve, but encapsulated in a 
template:
     alias Tuple!(int, "aoeu", short) A;
     alias Tuple!(int, "aoeu", short) B;
     foreach(i, T; A) {
         pragma(msg, i, " ", T);
         pragma(msg, isEqual!(T, B[i]));
     }


More information about the Digitalmars-d-learn mailing list