let's assume I have some class A and derived from it B:
I want to write operator= for B (let's assume that I have operator= in my A class)
right way to do this:
B& B::operator=(const B& rhs)
{
if(this == &rhs) return *this;
((A&) *this) = rhs; //<-question
//some other options
return *this
}
what is the difference if I write
((A) *this) = rhs;
thanks in advance