|
Boost Users : |
Subject: Re: [Boost-users] How to make multi_index_container work withstd::unique_ptr?
From: Igor R (boost.lists_at_[hidden])
Date: 2011-12-20 18:01:36
> What I mean is dynamic changing. For example
>
> class B {public: virtual ~B()} Â // Base class.
> class D1 : public B {} Â Â Â Â Â Â // D1 derived from B
> class D2 : public B {} Â Â Â Â Â Â // D1 derived from B
>
> scoped_ptr<B> p = new D1; Â // pointing to D1
> p.reset(new D2); Â Â // change pointing to D2
>
> If they are shared between owners and users, I need type
>
> Â Â Â Â shared_ptr<scoped_ptr<B>>
>
> But this type make my code hard to develop and also read.
And what's wrong with just shared_ptr<B>? Why do you need the
additional level of indirection?
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