Unexpected copy constructor behavior

psycha0s bix at gmail.com
Fri Jul 10 07:31:58 UTC 2020

On Thursday, 9 July 2020 at 22:18:59 UTC, Steven Schveighoffer 
> Looking at the generated AST, it's because the compiler is 
> adding an auto-generated opAssign, which accepts a Foo by 
> value. It is that object that is being created and destroyed.

Is there a reason the autogenerated opAssign accepts its argument 
by value? Honestly, it looks like a premature pessimisation to me.

More information about the Digitalmars-d-learn mailing list