Boost logo

Boost :

From: Murray Cumming (murrayc_at_[hidden])
Date: 2001-08-17 07:36:41


I added this to the sourceforge Feature Requests, but I'm not sure that
anybody looks at that:

I'd like to use the shared_ptr smart pointer, but the underlying types
that I am using have their own specific *_alloc() and *_drop() functions
instead of using new/delete.

If the smart_ptr template classes took an allocator type as a template
arg then we would just have to define our own allocators for things like
this. By using a default allocator that used new/delete there would be
no impact on current code.
e.g.
template< typename T, typename Tallocator=default_allocator<T>>
class shared_ptr {};

Maybe the default_allocator<> is a bit like std::allocator<>, but I'm
not sure about that and admit to ignorance.

This would reduce the code for a lot of C-API wrapper projects.

Murray Cumming
www.murrayc.com
murrayc_at_[hidden]


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