Boost logo

Boost Users :

Subject: Re: [Boost-users] 1.37: boost::enable_shared_from_this fails whilestd::tr1 succeed s
From: Peter Dimov (pdimov_at_[hidden])
Date: 2009-01-23 08:30:33


Daniel Lidström:
> I have already found a workaround, but it is a little bit annoying:
>
> struct Sub : public Base,
> public tr1::enable_shared_from_this<Sub>
> {
> void f()
> {
> BasePtr basePtr =
> tr1::dynamic_pointer_cast<Base>(shared_from_this());
> }
> };
>
> I would like to avoid explicit type casts like this.

You don't need the cast.


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