__rvalue and Move Semantics first draft

Walter Bright newshound2 at digitalmars.com
Sat Nov 9 22:39:33 UTC 2024


Some great insights.

I suggest the most pragmatic implementation of your ideas is to append to the 
destructor calls to rvalue parameters a blit of the .init value. It is only 
necessary if the rvalue has a destructor. The callee cannot know if an rvalue 
was passed using __rvalue, so it has to defensively do this anyway.

I also suggest that maybe omit the blit for @system code, like we enable 
omitting array bounds checking in @system code. For efficiency, naturally!


More information about the dip.development mailing list