how to assign tuple named Tuple easily

Inquie via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Mar 12 17:02:12 PDT 2017


On Sunday, 12 March 2017 at 23:55:44 UTC, Adam D. Ruppe wrote:
> On Sunday, 12 March 2017 at 23:16:48 UTC, Inquie wrote:
>> Tuple!(int, "A") x;
>>
>> x = tuple(3);
>>
>> fails of course
>
> umm it works for me...

Ok, it doesn't work for appending though ;)

Tuple!(int, "A", double, "B")[] y;
y ~= tuple!("A", "B")(3, 2.5);

vs

Tuple!(int, "A", double, "B")[] y;
y ~= tuple(3, 2.5);

I just figured it didn't work in general, but seems to be an 
issue with appending.






More information about the Digitalmars-d-learn mailing list