5 Jun
2002
5 Jun
'02
9:59 p.m.
You usually use private inheritance for boost::noncopyable, that should prevent users from casting to boost::noncopyable. The boost::noncopyable destructor is also protected and *can* only be called by a derived class. class X : private boost::noncopyable { public: X() { } virtual ~X() { } }; int main() { boost::noncopyable* x = reinterpret_castboost::noncopyable*(new X()); delete x; } Should give a compile time error like cannot access protected member declared in class 'boost::noncopyable' Daniel