Boost logo

Boost :

From: cppljevans_at_[hidden]
Date: 2003-10-23 08:23:57

On 10/23/2003 08:01 AM, Maxim Egorushkin wrote:
> Michael Grundberg wrote:

> The key point is that shared_ptr<> is an exclusive owner of a raw
> pointer. No more then one shared_ptr<> should be constructed using
> the same raw pointer (unless it is 0 pointer). Violating the rule
> leads to multiple releases on the raw pointer. Using null_deleter
> allows you to remain unpunished :).

An alternative way to avoid this is to require share_ptr CTOR to take
something like auto_new<SomePolicy,SomeReferent> argument instead of
the SomeReferent* raw pointer argument. Please see:

Boost list run by bdawes at, gregod at, cpdaniel at, john at