Class Checklist

The following table will help you decide which all methods you need to implement in your C++ class. This list is by no means exhaustive.

If Then
You have implemented the copy constructor, overriden the assignment operator or have a virtual destructor As a rule of thumb, you need to implement all three of them.
You have derived your class from some other class and overriden the assignment operator Make sure that you call the base class' assignment operator. Use the syntax: this->base::operator=(myObject) to call the base class' assignment operator.
You have overriden the assignment operator Make sure that you take care of self assignment statement: object = object

Updated by Chirag Dalal.