$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 inheritedfrommore than one time
From: Björn Karlsson (Bjorn.Karlsson_at_[hidden])
Date: 2009-08-10 07:00:47
Hello Igor,
> Why not:
> boost::static_pointer_cast<B>(shared_from_this());
Yes, inside B (as in the example), static_pointer_cast is the right choice. The same rules apply as for the corresponding C++ casts, so when downcasting, shared_pointer_cast should be used instead.
Cheers,
Bjorn Karlsson
www.skeletonsoftware.net