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 count_' and > methods > for adding and removing references. This allows you to have the count > embedded in your primary data, rather than having a separate > allocation for count as shared_ptr does.
This is what intrusive_ptr is for. Just define intrusive_ptr_add_ref and intrusive_ptr_release for your count class. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost