Boost logo

Boost Users :

Subject: Re: [Boost-users] [bind] Doubt regarding the use of shared_ptr with boost.bind
From: Igor R (boost.lists_at_[hidden])
Date: 2010-09-23 13:12:01


> I think I don't quite completely understand functor.., is it by C++ that a
> functor will be destroyed automatically once executed? Or is this a feature from boost.bind?

This is a feature of asio::io_service.
By saying "functor" I mean the function-object that bind() returns.
This object stores your shared_ptr as a member-data. You pass this
object to io_serivce::post(), and when io_service is done with this
function-object, io_service removes it from the internal queue - so
the object is being destroyed with all its members.


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