Re: Tuple deconstruction in Phobos

2024-07-21 Thread Nick Treleaven via Digitalmars-d-learn
On Sunday, 21 July 2024 at 04:05:52 UTC, IchorDev wrote: On Saturday, 20 July 2024 at 20:48:29 UTC, Nick Treleaven wrote: Instead of the `tie` assignment, you can just do: ```d import std.meta; AliasSeq!(y, x) = tupRetFn().expand; ``` And here I was trying to use comma expressi

Re: Tuple deconstruction in Phobos

2024-07-20 Thread IchorDev via Digitalmars-d-learn
On Saturday, 20 July 2024 at 20:48:29 UTC, Nick Treleaven wrote: Instead of the `tie` assignment, you can just do: ```d import std.meta; AliasSeq!(y, x) = tupRetFn().expand; ``` And here I was trying to use comma expressions for this like a buffoon! Of course they didn't work,

Re: Tuple deconstruction in Phobos

2024-07-20 Thread Nick Treleaven via Digitalmars-d-learn
On Saturday, 20 July 2024 at 14:02:21 UTC, IchorDev wrote: Why does Phobos not provide a method to easily deconstruct tuples? Here's a trivial implementation: ... tie!(y, x) = tupRetFn().expand; writeln(x,", ",y); } ``` Not having this is like if Phobos didn't have `AliasSeq`. Y