First Draft: Tuple Unpacking Syntax

Timon Gehr timon.gehr at gmx.ch
Wed Aug 20 16:11:42 UTC 2025


On 7/31/25 13:46, IchorDev wrote:
> I really don't understand why it wouldn't be supported

Because it is not implemented and there is not yet a spec for it. Also, 
move semantics is still somewhat in flux.

I guess one way to do it for tuples would be to move each field on its 
own if the unpack rhs is an rvalue. Not sure how to implement that, but 
I can try during the dconf hackathon. I guess would need to call the 
move constructor and then blit `.init` on the source field.

Ideally though it would not even run the destructor on the moved fields 
anymore. Eliding all the destructor calls would need some cooperation 
from the tuple type though.

I had hoped there would be some way to move on last use and avoid any 
further destructor calls, but it's not really where we have been moving 
so far and therefore there has been no progress on interations of 
unpacking with moves either.


More information about the dip.development mailing list