By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,501 Members | 2,768 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,501 IT Pros & Developers. It's quick & easy.

why assignment operator not inherited in derived class in c++

P: 1
why assignment operator operatoerdoes not inherited in c++
Sep 7 '10 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 8,916
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.
Sep 7 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.