Boost logo

Boost Users :

Subject: Re: [Boost-users] Flyweight: wrapping shared_ptr
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2014-10-09 16:23:12


Thorsten Ottosen <tottosen <at> dezide.com> writes:

>
> On 09-10-2014 11:50, Akim Demaille wrote:
>
> > I think it now does what I want, if you're curious:
> >
> > http://coliru.stacked-crooked.com/a/cacc6107cf22c2e6
> >
>
> Just took a quick look. I would prefer if you used
> scoped_ptr inside poly_holder.

Hi Thorsten,

poly_holder has a very different semantics than scoped_ptr's:

1. Constructing from a const Base& does not involve heap allocation.
2. Copying involves either heap allocation and cloning if the
copied elements didn't allocate, or ownership transfer otherwise.

Joaquín M López Muñoz
Telefónica


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