why assignment operator operatoerdoes not inherited in c++
why assignment operator not inherited in derived class in c++
Collapse
X
-
Tags: None
-
It is one of those methods that has some strangeness, like the constructors and destructor.
Inheriting the assignment operator would not serve any particularly useful purpose in the most likely case that the derived class has data of its own since the derived class data would not be copied resulting in a assignment operator that does not do a full copy.
The default assignment operator provided by the compiler calls the assignment operators of any base classes of the current class as part of its operation.
Comment