No, this is not necessary. If your class does not have a virtual destructor, in any case, nothing will come of it. So do not give it.
You can use this trick copied from the Stroustrup Frequently Asked Questions :
class Usable; class Usable_lock { friend class Usable; private: Usable_lock() {} Usable_lock(const Usable_lock&) {} }; class Usable : public virtual Usable_lock {
In C ++ 0x (and as an extension in MSVC) you can make it pretty clean:
template <typename T> class final { private: friend T;
GManNickG
source share