Boost logo

Boost :

From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2002-05-10 03:18:27


"Darin Adler" <darin_at_[hidden]> wrote in message
news:708B6FB1-6370-11D6-BE6B-

> One of the reasons for keeping a deleter along with the pointer is to
allow passing around shared_ptr objects even when the > complete type of the
pointed-to object is not visible.

I uploaded my latest version, that among other things implement this nice
feature. More over in addition you will get:
1. you can attach custom deleter to any smart pointer.
2. it won't require destructor not only for shared_ptr but for any other
smart pointer to implementation;
3. it cleanly separate notion of custom deleter from completely unrelated
notion of shared counter
4. In majority of the cases memory overhead is only 4 bytes (in worst case
8), while current implementation has at least 9 (if I am reading correctly
the code).

The code is located now here:
http://groups.yahoo.com/group/boost/files/smart_pointers/Policy%20based%20sm
art_ptr/smart_ptr.zip

For specific example see test test_pm_scoped_ptr in smart_ptr_test.cpp.

Regards,

Gennadiy.


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