Boost logo

Boost Users :

From: Edward Diener (eldiener_at_[hidden])
Date: 2008-01-03 18:36:55


Michael Bradley Jr wrote:
> Hi,
>
> can someone please provide me an elegant way to solve the current problem.
>
> class A;
> class B : public A;
>
> boost::shared_ptr<A> pA;
> boost::shared_ptr<B> pB;
>
>
>
> Would like to cast pB to pA with a construct like the *static_cast* but that
> ain't really pretty !

It implicitly casts except on some backward compilers, where it can
fail. See the boost::shared_ptr documentation under the introduction,
6th paragraph.


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