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

Max Haughton maxhaton at gmail.com
Sun Mar 7 04:15:38 UTC 2021


On Saturday, 6 March 2021 at 19:16:51 UTC, deadalnix wrote:
> 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.

The point about destructors at least is true at least according 
to ldc and gdc.


More information about the Digitalmars-d mailing list