Boost logo

Boost :

From: Scott Maxwell (scott_at_[hidden])
Date: 2003-04-17 15:26:37


>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 pointer to your class. This can be
problematic if your client class is a nested private class as in my prior
example.

2. You must define the functionality of those two functions. While the
functionality is trivial, it still needs to be done manually for each
class. Anything manual is subject to error.

The shared_ptr_embedded and shared_ptr_count pair solve both issues.

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