tuples

Saaa empty at needmail.com
Thu Jun 11 21:50:31 PDT 2009


> what is up with this code?
>
> auto t = tuple(1,'a',3.333,false);
> pragma(msg,typeof(t.tupleof[2 .. $]).stringof);
>
> spits out
>
> (double, bool, int, char, double, bool)


template Tuple(E...)
{
alias E Tuple;
}
alias Tuple!(1,'a',3.333,false) t;
pragma(msg,typeof(t.tupleof[2 .. $]).stringof);
//Error

pragma(msg,typeof(t[2..$].stringof);
//writes (double, bool)




More information about the Digitalmars-d-learn mailing list