Warning on self assignment

Jonathan M Davis newsgroup.d at jmdavisprog.com
Wed Apr 25 11:35:41 UTC 2018


On Wednesday, April 25, 2018 02:32:32 Per Nordlöw via Digitalmars-d-learn 
wrote:
> On Wednesday, 25 April 2018 at 02:23:04 UTC, Mike Franklin wrote:
> > Are people using self assignment of structs as a way of
> > force-running the postblit?  Is there a valid use case for that?
> >
> > Mike
>
> If they are, there should be a better way of force-running the
> postblit.

Under what circumstances would it be reasonable to force the postblit to
run? Certainly, under any kind of normal circumstances, the postblit
constructor should only be run as a result of the object being copied -
which the compiler controls.

- Jonathan M Davis




More information about the Digitalmars-d-learn mailing list