How inheriting a noncopyable class with a private copy constructor and an assignment operator is going to prohibit the use of copy constructor and assignment operator on the derived class? Please consider the following scenario while replying,
• Default copy constructor and assignment operator are generated by the compiler in the derived class and not added by the programmer
• Copy constructor and assignment operator are defined and declared public in the derived class by the programmer
• Copy constructor and assignment operator are defined and declared private in the derived class by the programmer
• Copy constructor and assignment operator are defined and declared public in the derived class by the programmer
• Copy constructor and assignment operator are defined and declared private in the derived class by the programmer
If you make this changes than derived class already wasn't be noncopyable. So why you need derive form noncopyble if want have possibility to copy objects of derived class?
@QTsik: > So why you need derive form noncopyble if want have possibility to copy objects of derived class?
+1
Hmmm... So QTsik gets reported for making a good post?
> How inheriting a noncopyable class with a private copy constructor and an assignment operator
> is going to prohibit the use of copy constructor and assignment operator on the derived class?
In a class that inherits from noncopyable, if the copy constructor and assignment operator are implicitly declared, they are declared as deleted. (C++98: prohibit the implicit declaration of the copy constructor and assignment operator).