
11 Feb
2007
11 Feb
'07
6:54 a.m.
Frank Mori Hess wrote:
Okay, so how about l slightly modify my suggestion to be: store the slot signal as a trivial wrapper function object that holds a weak_ptr to the signal's pimpl, and has an operator() function corresponding to signal invocation. Is that essentially your plan?
Yes, the signal classes in the original implementation are basically a thin wrapper around it. I suggest to add something like a bool "genuine" as a member, provide a protected copy constructor that initializes it to false (while the public constructor sets it to true) and work with full copies of the signal object. The destructor can disconnect all slots when "genuine" is true. Regards Timmo Stange