Generated opAssign in the presence of a copy constructor

RazvanN razvan.nitu1305 at gmail.com
Fri Jul 27 08:14:34 UTC 2018


> Why the memcpy?
> This looks inefficient.
>
> Is it in case the constructor throws?
> Have a 'nothrow' case where it constructs directly to this?

The copy constructor must be called on an object in the initial 
state,
so it cannot be called directly on this as it is already 
initialized.

__dtor is used as a matter of demonstration. Indeed, xdtor is the 
the alias which points to the generated destructor (__dtor, 
__fieldDtor or __aggregatedDtor)


More information about the Digitalmars-d mailing list