Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-11-09 15:17:41


Michael Schneider wrote:

> Is there a reason why shred_ptr does not accept an allocator?

shared_ptr doesn't have an allocator template parameter because this would
encode an implementation detail into its type. An important design principle
of shared_ptr<T> is to hide such specific requirements behind an opaque type
that just "does the right thing" when it comes to deallocation/destruction.

This doesn't mean that shared_ptr shouldn't accept an allocator, though. The
proper way to add allocator support would be via an additional constructor:

template<class Y, class D, class A> shared_ptr( Y * p, D d, A a );

and a corresponding reset.

Now in CVS. ;-)

> - If a change is required, what can I do to help make this change
> in boost (I am new to the boost community)?

You can contribute a test for the new functionality. :-)


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