1

A simple question which probably doesn't require much explanation, only an example.

Consider a move assignment operator:

myclass& operator=(myclass&& c)
{
    if(this != &c)
    {
        // Do stuff
    }

    return *this;
}

Is it sensible to include the if(this != &c) check? (For a move assignment operator.) If so [or so not], why?

FreelanceConsultant
  • 13,167
  • 27
  • 115
  • 225

0 Answers0