Move assignment operator: Difference between revisions

Content deleted Content added
Clean up examples
No edit summary
Line 18:
public:
Resource& operator=(Resource&& other) {
if (this != &other) { // If thewe're objectnot isn'ttrying beingto calledmove the object oninto itself...
delete this->data; // Delete the object's original data.
this->data = other.data; // Copy the other object's data into this object.