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

deadalnix deadalnix at gmail.com
Thu Mar 11 00:31:01 UTC 2021


On Wednesday, 10 March 2021 at 22:51:58 UTC, tsbockman wrote:
> Am I the only one who thinks that it would be better to have 
> syntax that accurately reflects the semantics, instead of just 
> documenting "this syntax is a lie"?

No, I think there is a problem with using opAssign here, because 
"this" will refers to something that is possibly uninitialized, 
and the old value may not be consumed fully.

Due to problem #1, this kinda need to be a constructor rather 
than an opAssign.
Due to problem #2, this kinda need not to take another struct as 
argument.

Which leave me with the one conclusion: the postblit needs to be 
recycled into a move constructor.


More information about the Digitalmars-d mailing list