Subject: Re: [boost] Subject: Re: [shared_ptr] Where is the bug?
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2008-10-03 13:53:55
-----BEGIN PGP SIGNED MESSAGE-----
On Friday 03 October 2008 12:39 pm, vicente.botet wrote:
> Yes, I know. I was not wondering about why the X's destructor is not run
> when deleting b, but why the X's destructor is called when deleting ptr. I
shared_ptr has some magic so it deletes through the same type of pointer that
was passed to its constructor, which can eliminate the need for virtual
destructors in some cases. Notice how the shared_ptr constructors take the
pointer as a template parameter of the constructor, as opposed to just using
the template type of the shared_ptr itself.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
-----END PGP SIGNATURE-----
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk