
10 Aug
2009
10 Aug
'09
12:52 p.m.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 10 August 2009, Björn Karlsson wrote:
Don't let B inherit from enable_shared_from_this. You've already done that in A. So your question then becomes "how do I retrieve a shared_ptr<B> from this?". Here's how:
boost::shared_dynamic_cast(shared_from_this());
The shared_*_cast names are deprecated according to shared_ptr.hpp. They are spelled *_pointer_cast now. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkqAF/EACgkQ5vihyNWuA4VqFgCeO+XJhSihS1m+vxsDY0niQeEW 8LsAniPa51EYxc+dcwiI0ZdNndHsi9Wn =KWJb -----END PGP SIGNATURE-----