Boost logo

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);
    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

        C++ Booster (
          email: david.abrahams_at_[hidden]

Boost list run by bdawes at, gregod at, cpdaniel at, john at