$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-08-14 10:18:38
Alan M. Carroll:
>I greatly prefer intrusive_ptr to shared_ptr, but one drawback of that is 
>there is no equivalent of weak_ptr. I have started work on a class to do 
>that and my biggest question, honestly, was what to name it.
>
> The basic logic turned out to be fairly simple.  The target class declares 
> a member that is an instance of the weak pointer. Other classes that want 
> a weak pointer to the target instance also declare a member weak pointer, 
> which must be initialized with a copy of the target instance member. The 
> member provides a method to generate an intrusive_ptr to the target, which 
> is either valid or nil depending on whether the target has been 
> destructed. When the target and all weak pointers are destructed, 
> everything gets cleaned up. The weak pointers don't affect the target 
> reference count. No changes to Boost.intrusive_ptr are required.
Will you make the code available for review?