-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 07 July 2009, Marc DelaCruz wrote:
Doing the following seems to work.
So it turns out Boost.Bind does return function objects that are equality comparable, albeit not with the proper semantics for comparison against a boost::function. However, Boost.Bind also provides undocumented function_equal overloads which do make comparison against boost::function objects work. So you can use a boost::bind return value to disconnect-by-slot, although IMO using signals2::connection objects is still preferable.
I have equivalent slots tied to the signal and needed to disconnect only specific ones. I guess I could force a grouping for each added slot and disconnect via the grouping.
template<typename T> void disconnect (void (T::*pMemFunc)(), T* pObj, VoidSignal& rSig) { rSig.disconnect(boost::bind(pMemFunc, pObj)); }
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org]On Behalf Of Frank Mori Hess Sent: Tuesday, July 07, 2009 10:31 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] [Signals2] Signal disconnect wrapper won't work
I don't believe the function objects returned by bind are either. The best workaround would be to not use disconnect-by-slot at all and use the connection object returned by the connect call to disconnect. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkpTtqwACgkQ5vihyNWuA4Ul5QCffTidOo2dPMGANu67sex0ZX3V X4sAoOFgy3ZY+pawBzC+e0SGHL3505ew =+AOn -----END PGP SIGNATURE-----