: For a derived class
D
with a base class
B
for which a virtual copy/move assignment has been declared,
the copy/move assignment operator in
D
does not override
B's
virtual copy/move assignment operator
. [
Example:
struct B {
virtual int operator= (int);
virtual B& operator= (const B&);
};
struct D : B {
virtual int operator= (int);
virtual D& operator= (const B&);
};
D dobj1;
D dobj2;
B* bptr = &dobj1;
void f() {
bptr->operator=(99); *bptr = 99; bptr->operator=(dobj2); *bptr = dobj2; dobj1 = dobj2; }
—
end example ]
—
end note