Type tuple pointers

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Thu May 21 09:11:30 PDT 2015


On 05/21/2015 05:37 PM, Dicebot wrote:
> On Thursday, 21 May 2015 at 15:30:59 UTC, Alex Parrill wrote:
>> They aren't types themselves, so `TypeTuple!(int, char) var` doesn't
>> make sense.
>
> Sadly, you are wrong on this one - this is actually a valid variable
> declaration which will create two distinct local variables and uses
> their aliases in resulting symbol list named 'var'.

A wacky property of such variable declarations is this one:

import std.stdio;
alias Seq(T...)=T;

void main(){
     char y='a';
     Seq!(char,char) x=y++;
     writeln(x);
}



More information about the Digitalmars-d mailing list