Boost logo

Boost Users :

From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2007-02-23 11:23:49


On 2/23/07, Frank Mori Hess <frank.hess_at_[hidden]> wrote:
> >
> > Could you give a short example of how that would look with using bind
> > and a simple free function expecting a pointer or reference to an
> > object that should be tracked?
>
> Attached.
>

>From the attached:
  boost::shared_ptr<coordinate> coord(new coordinate);
  coord->x = 5;
  sig.connect(boost::bind(&myfunction, boost::signalslib::track(coord,
boost::ref(coord->x))));

Does the track() do magic within bind() such that it really has
nothing to do with the signal?
ie did you (or can we) build a bridge between weak_ptrs and
bind/function, independent from signals?

That would be really useful. Makes me start to think some of the work
is being done in the wrong place - signals/slots still needs to be
threadsafe, but a bind/function that handles lifetime issues would
take some of the work away from signals and could be used in a lot
more places.

Tony


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