Defining copy constructor and using unique_ptr in order to automatically destroy
the array of data when the object gets destroyed.