Boost logo

Boost Users :

From: James Swift (james_at_[hidden])
Date: 2006-06-06 15:00:52


Thank you!
Didn't even need boost::bind.

regards,

James.

me22 wrote:
> On 6/6/06, James Swift <james_at_[hidden]> wrote:
>
>> Now assume I'm also very often constructing and destroying nodes. An
>> object pool is an obvious optimisation to try out. However shared_ptr
>> would need to call object_pool::destruct() instead of delete when it
>> really wants to destroy the object. Or singleton_pool::free() but this
>> causes more difficulties for me because I want to control the lifetime
>> of the pool separately for each instance of my objects which are working
>> on these trees.
>>
>>
> shared_ptr can have a custom deleter, which might be exactly what you
> need. It's fairly simple to create with Boost.Bind, too:
> boost::bind( &object_pool::destruct, ref(the_pool), _1 )
> ( or similar, I'm not sure if those are exactly the right names and such )
>
> ~ SWMc
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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