Wenjie wrote:
Suppose I have:
class B {
protected:
virtual ~B();
};
class D: public B {
public:
~D();
};
Is it a good practice to use "protected" in class B?
Not an answer to your question, but something to keep i mind:
Making your dtor protected will keep your class from being used in 3rd-party
custom memory-mgt code which calls the dtor directly (as in,
thefoo->~foo()).
--
----- stephan beal
Registered Linux User #71917
http://counter.li.org
I speak for myself, not my employer. Contents may
be hot. Slippery when wet. Reading disclaimers makes
you go blind. Writing them is worse. You have been Warned.