Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-09-02 16:30:36

David Abrahams wrote:
> Gregory Colvin <gregory.colvin_at_[hidden]> writes:
>>> Also, if shared_ptr only needs to allocate at construction time (I'm
>>> not sure of this) we can avoid storing the allocator at all.
>> Then how to deallocate?
> Using the custom deleter?

The deleter takes care of the pointee, but we are talking about the count. I

I still find the

    list< shared_ptr<X> >

hypothetical example where everything needs to use the same custom allocator
somewhat artificial. In "custom allocator" situations I find

    vector< X* >

a somewhat better choice since it has much less overhead. But I may be
wrong. :-)

Boost list run by bdawes at, gregod at, cpdaniel at, john at