Boost logo

Boost Users :

Subject: Re: [Boost-users] shared_ptr with custom allocator but default deleter?
From: Peter Dimov (pdimov_at_[hidden])
Date: 2010-03-18 19:00:07


Rhys Ulerich wrote:

> I'm missing something w.r.t. shared_ptr and custom allocators...
>
> I'd like to use the following shared_ptr constructor
> template<class Y, class D, class A> shared_ptr(Y * p, D d, A a);
> with a custom allocator but "the usual deleter behavior". I'm
> confused about what to supply for 'd'.
>
> Restating my confusion, first pretend the signature was this
> template<class Y, class A> shared_ptr(Y * p, A a);
> and ignore the normal shared_ptr two argument constructor for the
> moment. Now pretend I could implement this hypothetical two argument
> version by delegating to the three argument version. What would I
> supply as the 'd' parameter?

boost::checked_deleter<Y>().


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net