Boost logo

Boost :

From: Scott McMurray (me22.ca+boost_at_[hidden])
Date: 2008-03-10 20:22:39


On Mon, Mar 10, 2008 at 6:18 PM, Mathias Gaunard
<mathias.gaunard_at_[hidden]> wrote:
> It seems to me that shared_ptr was made inefficient by design, which is
> not a really good thing since it is getting more and more popular.
>
> Could someone confirm or infirm this?
>

shared_ptr is the only one with the oft-undervalued weak_ptr, and
let's you say "here, use this" with no additional changes. It's not
excessively inefficient, so will usually be "good enough", and for
those people that need something else, there are other options
available.

Also, "As a general rule, if it isn't obvious whether intrusive_ptr
better fits your needs than shared_ptr, try a shared_ptr-based design
first" (http://boost.org/libs/smart_ptr/intrusive_ptr.html).


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk