Boost logo

Boost :

From: cppljevans_at_[hidden]
Date: 2003-10-27 18:21:06


On 10/27/2003 01:34 PM, David B. Held wrote:
> The latest version is in the Sandbox now under "latest".
>
I'm attempting a policied smart_ptr which can collect cycles.
I've got a prototype, but the it uses a simplified version
of smart_ptr with just the StoragePolicy (since that's
the only policy that important for collecting cycles).
The code (which just includes the .hpp files) has just
been uploaded to */files/shared_cyclic_ptr/cyclic_smart_ptr.zip.
The most important file w.r.t. cycle collection is the
refcount_break_cycles_local.hpp, which includes a specialization
of the storage_policy_ptr class for collecting cycles. I figure
the shared_ptr could likewise be a specialization of this
class. To be more specific, the smart_ptr

  isa policy_referent_ptrs<Policy,Referent>
  isa storage_policy_ptr, referent_ptr

and these last to class correspond with the:

   shared_ptr::pn //wrapper around counter*
   shared_ptr::px //the referent*

I was hoping this arrangement would be compatible with or
at least adaptable to any changes you're planning on making
to smart_ptr. Please let me know if you think this is
not so.


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