Boost logo

Boost Users :

From: Frank Mori Hess (fmhess_at_[hidden])
Date: 2007-02-25 12:08:11


On Sunday 25 February 2007 11:42 am, Peter Dimov wrote:
> > signal.connect(signal_type::slot_type(slot, _2, _1).track(slot));
> >
> > It's a bit murky whether track(slot) would only cause the tracked
> > objects of slot to get tracked, or also track the slot itself (or its
> > pimpl). I suppose it would depend on whether copies of slots are deep
> > or share the same SlotFunction.
>
> You don't need tracking for the above example; bind( slot, _2, _1 )
> stores a copy of slot. Signals currently need tracking because they're
> noncopyable and are bound using ref(). A copyable signal does not,
> regardless of the semantics of the copy (deep, shallow, or something in
> between - deep for the signal, shallow for the contained slots).

But you need to at least copy the list of tracked objects from the slot
inside the bind to the slot received by connect(). Or, you would have to
use visit each to discover any slots inside the bind and get their tracked
object lists.

-- 
Frank



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