struct A{
A& operator=( const A& a ){ i = a.i; return *this; }
private:
int i;
};
struct B : public A{
B& operator=( const B& b ){ j = b.j; return *this; } // how to copy i?
private:
int j;
};
In the above code, what would be the standard way of coping A::i in
B::operator= ?
A& operator=( const A& a ){ i = a.i; return *this; }
private:
int i;
};
struct B : public A{
B& operator=( const B& b ){ j = b.j; return *this; } // how to copy i?
private:
int j;
};
In the above code, what would be the standard way of coping A::i in
B::operator= ?
Comment