
10 Aug
2009
10 Aug
'09
8:05 a.m.
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());
Why not: boost::static_pointer_cast<B>(shared_from_this());