Boost logo

Boost Users :

Subject: Re: [Boost-users] How to make multi_index_container work with std::unique_ptr?
From: Jayden Shui (jayden.shui_at_[hidden])
Date: 2011-12-20 14:54:26


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.

On Tue, Dec 20, 2011 at 2:14 PM, Igor R <boost.lists_at_[hidden]> wrote:

> > If the elements of a multi_index_container are std::unique_ptr, it
> doesn't
> > seem to work because the assignment operator of std::unique_ptr is
> private.
> > Any way to let it work? If I change unique_ptr to shared_ptr, it works.
> But
> > I need a good performance. Or is there anyway to work around to get
> pointer
> > container performance with multi index power?
>
>
> Why do you think it would affect your program performance? Have you
> run profiler, or it's just a guess?
> I use MIC with shared_ptr a lot and it never was a bottleneck.
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users



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