Boost logo

Boost Users :

Subject: Re: [Boost-users] intrusive_ptr vs shared-ptr
From: Igor R (boost.lists_at_[hidden])
Date: 2013-01-19 13:59:18


> "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."
>
> but does not explain why.
>
> If the classes involved are all my own and deriving them all from a base class
> that implements reference-counting is not a problem, what are some reasons
> to prefer shared_ptr to intrusive_ptr?

Because shared_ptr doesn't require *any* additional code (which should
be designed, implemented, tested, supported, etc).


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