On 7/10/20 3:31 AM, psycha0s wrote:
On Thursday, 9 July 2020 at 22:18:59 UTC, Steven Schveighoffer wrote:
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.
If it accepts the value by ref, then it will not bind to rvalues.
Accepting by value accepts anything.
-Steve