$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-12-12 10:19:08
From: "abierbaum" <allenb_at_[hidden]>
> The problem boils down to:
>
> How do I pass a reference to myself ( shared_ptr<TYPE>(this) ) to
> someone else in a safe way?
To solve this problem I implemented an intrusive smart pointer (that calls
add_ref() and release() on the contained object.)
shared_ptr<> (or any other non-intrusive smart pointer) cannot be safely
constructed from a raw pointer (that is already owned by another
shared_ptr.) It's technically possible to maintain a global map of addresses
but I don't think it's worth it.
-- Peter Dimov Multi Media Ltd.