Type tuple pointers

John Colvin via Digitalmars-d digitalmars-d at puremagic.com
Thu May 21 09:23:11 PDT 2015


On Thursday, 21 May 2015 at 16:11:30 UTC, Timon Gehr wrote:
> 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);
> }

Yikes.


More information about the Digitalmars-d mailing list