Copy semantics (part 2)
Implementing a deep copy policy
The rule of zero and the rule of three
Activity: Rule of three for a two-dimensional arrayGraded Playground Autograder
This activity requires you to define the rule of three functions for the class
Array2D. The copy policy you implement must perform a deep copy.
The objects derived from this class blueprint maintain a two-dimensional array on the free store through their
int** array_ data member.
array_ points to an array of
int* objects. Each
int* in turn points to an array of
int objects. When implementing your deep copy policy, if the
ArrayOfArrays object being copied from is empty (defined as its
nullptr), ensure the object being initialized or assigned to has the same values as it would upon default constructed.
Member functions you are to implement
||Destructor. Deallocates all dynamic objects associated with
||Copy Assignment Operator.
Provided member functions