$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] How to obtain shared_ptr<Derived> from shared_ptr<Base>?
From: Nat Goodspeed (nat_at_[hidden])
Date: 2009-04-15 10:56:31
Dominique Devienne wrote:
> So long story short, is there a clean way to obtain a
> shared_ptr<VehiculeIdent> from a shared_ptr<Ident> which one "knows"
> is a VehiculeIdent, to avoid my as_shared_ptr hack above?
Use dynamic_pointer_cast:
http://www.boost.org/doc/libs/1_38_0/libs/smart_ptr/shared_ptr.htm#functions