Boost logo

Boost Users :

Subject: Re: [Boost-users] How to make multi_index_container work withstd::unique_ptr?
From: Andrew Holden (aholden_at_[hidden])
Date: 2011-12-20 15:02:56


On Tuesday, December 20, 2011 2:54 PM, Jayden Shui wrote:
>
> It is just my guess. In fact I need MIC with shared_ptr to a
> scoped_ptr. The shared_ptr is used to count number of uses,
> while the scoped_ptr used to handle polymorphic objects. I
> feel a little nervous with that.

There should be no need for both pointer types. Shared_ptr handles
polymorphic objects just fine.

A MIC holding shared_ptrs to your base class should do what you need,
and the overhead associated with the shared_ptr should be negligible.


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