Wednesday, November 23, 2011

Things to be taken care of in defination of assignment operator

  • Deep copy/shallow copy
  • Guard against self assignment in the assignment operator.
  • Strong exception safety in the assignment operator. (acquire new resources before deleting old)
  • Call base class's assignment operator if needed.

No comments:

Post a Comment