|
Boost : |
From: Scott Maxwell (scott_at_[hidden])
Date: 2003-04-17 17:01:04
>No, you only need to implement the addref/release functions for the base
>class. See libs/smart_ptr/test/intrusive_ptr_test.cpp for an example.
>
>A future boost release will probably contain such a base class. I didn't
>want to introduce one at this time since it may have created confusion, as
>1.29 had boost::counted_base that was automatically recognized by
>shared_ptr. In 1.30 shared_ptr no longer supports intrusive counting.
Hmm, sounds like that is essentially what my shared_ptr_count turned out to
be. How about just renaming shared_ptr_count to intrusive_ptr_count_base
or something like that and including it in the intrusive_ptr.hpp
file. That way people can roll their own if they like or just use the
included mechanism if that is more convenient. Seems better than leaving
it as an exercise for the user.
Also, I added a 'release' method to my version of intrusive_ptr. I needed
this to get out of a circular reference situation.
Scott Maxwell
PocketPurchase, Inc.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk