[Issue 18426] Conversion from Tuple with named fields to Tuple without named fields should work during compilation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 12 22:04:49 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18426

--- Comment #3 from Andrei Alexandrescu <andrei at erdani.com> ---
(In reply to Seb from comment #2)
> And a stripped down version of std.typecons.Tuple:
> 
> https://gist.github.com/wilzbach/0a55a571f1c46e9d59420cf158354b85
> 
> > A better implementation would be to have the Tuple with named fields use the Tuple with no named fields as its only member variable; then, "alias this" needs to simply return a reference to that member.
> 
> This is already done:

Nonono, we need to do this:

Tuple!(int, "x", int, "y") should have as its only state Tuple!(int, int). In
the form of a data member that is. Call that field impl. Then:

alias impl this;

--


More information about the Digitalmars-d-bugs mailing list