Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2007-02-25 11:42:13


Frank Mori Hess wrote:

> Couldn't tracked objects could be copied from one slot to another by
> overloading slot::track to accept a slot as an argument? Then binding a
> slot to another slot with a different signature would might look like
>
> 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).


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