Do you have usecases for opAssign?

FeepingCreature feepingcreature at gmail.com
Fri Jun 29 07:15:38 UTC 2018


I'm doing a pull request to rewrite Nullable to use 
moveEmplace/move to replace its internal value. I'm considering 
whether it's better to let Nullable destroy its existing value, 
then memcpy the new one over it (via move()), or if it already 
has a value in it, if an opAssign to Nullable should assign to 
the underlying type.

With that in mind: what *is* opAssign actually good for, now that 
we have move/moveEmplace?

What usecase for opAssign would break if we replaced it with 
destructor + copy + postblit?


More information about the Digitalmars-d mailing list