equals operator c 2b 2b overlaod

Solutions on MaxInterview for equals operator c 2b 2b overlaod by the best coders in the world

showing results for - "equals operator c 2b 2b overlaod"
Miguel
03 Aug 2018
1  MyClass& MyClass::operator=(const MyClass &rhs) {
2
3    // Only do assignment if RHS is a different object from this.
4    if (this != &rhs) {
5      ... // Deallocate, allocate new space, copy values...
6    }
7
8    return *this;
9  }