I thought that theoretically the answer to this question was yes.
However, in practice, my compiler (VS2010) does not seem to complain in the following situation: I have an abstract base class that provides some common interface (yet has no data) and various sub and subclasses derived from it.
class Base { public: Base() {} virtual ~Base() {} virtual void interfaceFunction1() = 0; virtual void interfaceFunction2() = 0; private: Base(const Base&);
My compiler found that to implement full-text constructors in sub- or subtasks, itβs not even easy to implement full-copy constructors.
How can I make sure that every class derived from Base is not available?
edit: If I understand well, this is exactly what Scott Meyers explained in Section 6 of Effective C ++ (3rd edition, 2005) with his idea of ββthe Uncopyable class (only the full interface class extended here). What is the difference that makes it work? (I know that he inherits privately, but this should not be a problem)
source share