Tuple DIP

Timon Gehr timon.gehr at gmx.ch
Sat Jan 13 21:05:27 UTC 2018


On 13.01.2018 21:49, Timon Gehr wrote:
> 
>> auto (name, email) = fetchUser();
>>     vs
>> auto {name, email} = fetchUser();
>>

BTW: What do you think each of those do?
I'd expect the following:

---
auto (name, email) = fetchUser();
=>
auto __tmp = fetchUser();
auto name = __tmp[0], email = __tmp[1];
---

---
auto {name, email} = fetchUser();
=>
auto __tmp = fetchUser();
auto name = __tmp.name, email = __tmp.email;
---

The DIP proposes only the first one of those features, and only for 
AliasSeq's or types that alias this to an AliasSeq (such as tuples).


More information about the Digitalmars-d mailing list