$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Andrew Holden (aholden_at_[hidden])
Date: 2007-10-02 14:11:13
Peter Dimov wrote:
> In this case, you can use
>
> struct B : A
> {
> shared_ptr<B> getB()
> {
> return dynamic_pointer_cast<B>( shared_from_this() ); }
> };
>
> after making A polymorphic.
Is there any reason you couldn't use static_pointer_cast? You know for
a fact that the cast to B will work, as getB is a member function of B.
I think this will also remove the need to make A polymorphic.