$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] How shared_from_this() work when it inheritedfrom more than one time
From: Igor R (boost.lists_at_[hidden])
Date: 2009-08-10 04:05:46
> 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<B, A>(shared_from_this());
Why not:
boost::static_pointer_cast<B>(shared_from_this());