For instance if I have overloaded a + operator
myClass & operator + (const myClass & rhs)
and also overloaded = operator
myClass & operator = (const myClass & rhs)
both operators are working fine. Can I use this overloaded operator in my += operator overload?
myClass & operator += (const myClass & rhs){
*this = *this + progA;
return *this;
}
The above code is working okay. I just want to know if this is good code writing practice or I should re-use the code from the two previous implementations for the += operator overload.