On 08/16/2013 09:02 AM, Dicebot wrote:

> It does complicate things that sometimes TypeTuple is accepted in cases
> where comma-separated list does not:
>
> import std.typetuple;
>
> void main()
> {
>      //alias TT = TypeTuple!(int, string);
>      //TT twoVars;
>      (int, string) twoVars; // do you expect this to work?
>      static assert(is(typeof(twoVars[0]) == int));
>      static assert(is(typeof(twoVars[1]) == string));
> }

No, I would not expect that line to work.

However, I am totally amazed that your commented-out code works! Wow! :)

import std.typetuple;

void main()
{
    alias TT = TypeTuple!(int, string);
    TT twoVars;
    static assert(is(typeof(twoVars[0]) == int));
    static assert(is(typeof(twoVars[1]) == string));
}

I am speechless. :)

Ali

Reply via email to