Discussion Thread: DIP 1040--Copying, Moving, and Forwarding--Community Review Round 1

deadalnix deadalnix at gmail.com
Sat Mar 6 19:16:51 UTC 2021


On Friday, 5 March 2021 at 22:04:27 UTC, Max Haughton wrote:
> This is true, however it's worth saying that typically the 
> reason for having move semantics isn't so much performance (for 
> small objects) but managing the lifetime of the struct 
> properly. In this case for move semantics to be useful S would 
> probably have a destructor, which prevents passing in registers 
> anyway.

That is true in C++, that is NOT true in D at the moment.

If the proposal ends up forcing passage of non POD by reference 
rather than value at the ABI level (like in C++), then it's a non 
starter IMO.


More information about the Digitalmars-d mailing list