Tuple DIP

jmh530 john.michael.hall at gmail.com
Sat Jan 13 02:56:06 UTC 2018


On Saturday, 13 January 2018 at 02:15:37 UTC, Basile B. wrote:
> On Saturday, 13 January 2018 at 02:08:03 UTC, jmh530 wrote:
>> [snip]
>> Also, Proposal 1 starts with this example
>> auto (a, b) = tuple(1, "2");
>> (int a, string b) = tuple(1, "2");
>> but it also looks natural to be able to write
>> (int, string) (a, b) = tuple(1, "2");
>
> Really ?
> After the type should be the declarator. In this example 
> there's no declarator but if you add it then it becomes very 
> strange:
>
> (int, string) ab (a, b) = tuple(1, "2");

I left out a word there...I had meant that it would be natural to 
replace the auto version with that version. I would think it 
would work in combination with Proposal 3.

If
auto (a, b) = tuple(1, "2");
works, then surely
__Tuple!(int, string) (a, b) = tuple(1, "2");
should work, which is equivalent to
(int, string) (a, b) = tuple(1, "2");



More information about the Digitalmars-d mailing list