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

tsbockman thomas.bockman at gmail.com
Fri Mar 5 21:29:26 UTC 2021


On Friday, 5 March 2021 at 21:04:23 UTC, Ben Jones wrote:
> On Friday, 5 March 2021 at 20:29:01 UTC, tsbockman wrote:
>> Very small structs are often placed in registers when passed 
>> by value.
>
>> This optimization would need to be disabled for any type with 
>> a move constructor.
>
> I'm not sure it would need to be disabled.  I think the only 
> part that would really apply here is who has to call the 
> constructor.

If the main use case for move constructors is to update pointers 
into a struct instance, how can that work for an instance that no 
longer has an address in memory at all?

The move constructor itself takes its `this` parameter by 
reference. How would you even call the move constructor?


More information about the Digitalmars-d mailing list