Content deleted Content added
No edit summary |
Remove a redundant example |
||
Line 12:
* The operator must return a reference to "*this".
class
public:
if (this != &other) { // If we're not trying to move the object into itself...
delete this->data; // Delete the
this->data = other.data; // Copy the other
other.data = nullptr; // Finally, reset the other
}
return *this;
}
};
</syntaxhighlight>
==References==
<references />
|