|
Boost : |
From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-01-14 08:56:06
struct Base { Base(); ~Base(); };
struct Derived : Base { Derived(); ~Derived(); };
void unsafe()
{
shared_ptr<Derived> d(new Derived);
shared_ptr<Base> b(d);
d.reset();
b.reset(); // equivalent to delete (Base*)(new Derived)!!
};
Isn't shared_ptr just screaming for the application of John Maddock's new
is_polymorphic<> trait?
===================================================
David Abrahams, C++ library designer for hire
resume: http://users.rcn.com/abrahams/resume.html
C++ Booster (http://www.boost.org)
email: david.abrahams_at_[hidden]
===================================================
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk