Effective C++ item 12: Copy all parts of an object.

This one is simple. Don’t forget to copy all parts of an object in copy constructor or assignment operator!

There are two cases you tend to make mistakes.

  1. Make sure you modify copy constructor and assignment operator, if you add a member to a class.
  2. Make sure you call the copy constructor and assignment operator of base class in derived classes.

Reference:
“Effective C++” Third Edition by Scott Meyers.