Boost logo

Boost Users :

Subject: Re: [Boost-users] casting shared pointers to derived classes
From: Don Wilde (donintel11_at_[hidden])
Date: 2012-01-11 11:58:35


[snip]   Use tools provided by the shared_ptr itself... Take a look at http://www.boost.org/doc/libs/1_48_0/libs/smart_ptr/shared_ptr.htm#Synopsis, especially at these functions: template<class T, class U> shared_ptr<T> static_pointer_cast(shared_ptr<U> const & r); // never throws template<class T, class U> shared_ptr<T> const_pointer_cast(shared_ptr<U> const & r); // never throws template<class T, class U> shared_ptr<T> dynamic_pointer_cast(shared_ptr<U> const & r); // never throws  [snip] Thank you Ovanes and Thomas for your insights! I appreciate the help. :D



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net