Scott Maxwell wrote:
Hi All,
I have created a new shared_ptr class called shared_ptr_embedded.
This is based on the code for intrusive_ptr but differs in one
important
aspect. The struct/class pointed to is required to be derived from
shared_ptr_count. The latter class contains an 'int
This is what intrusive_ptr is for. Just define intrusive_ptr_add_ref and
intrusive_ptr_release for your count class.
Unless I have missed something, intrusive_ptr has the following issues:
1. You must declare intrusive_ptr_add_ref and intrusive_ptr_release as
top-level functions that take a
Scott Maxwell wrote:
This is what intrusive_ptr is for. Just define intrusive_ptr_add_ref
and intrusive_ptr_release for your count class.
Unless I have missed something, intrusive_ptr has the following
issues:
1. You must declare intrusive_ptr_add_ref and intrusive_ptr_release as
top-level
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