Boost logo

Boost Users :

Subject: Re: [Boost-users] 1.37: boost::enable_shared_from_this fails whil estd::tr1 succeed s
From: Daniel Lidström (daniel.lidstrom_at_[hidden])
Date: 2009-01-23 11:25:07


> 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.

Of course. Sorry I didn't see the obvious this time.

/Daniel


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