|
Boost Users : |
Subject: Re: [Boost-users] [Signals2] Signal disconnect wrapper won't work
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2009-07-07 11:31:06
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tuesday 07 July 2009, Marc DelaCruz wrote:
> So I guess the 'best' workaround would be to do something like below?
>
> template<typename T>
> void disconnect (void (T::*pMemFunc)(void), T& rObj, VoidSignal& rSig)
> {
> rSig.disconnect(VoidSlot(pMemFunc, rObj));
> }
>
That doesn't look like it would compile. signals2::slot objects aren't
equality comparable because boost::function objects aren't. 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)
iEYEARECAAYFAkpTajsACgkQ5vihyNWuA4X0bgCeKOe4rBBByM5n2/9VB/iJERKc
EdUAn3BT44t4LUZJrAa1gcTY3NlNP33A
=10Wb
-----END PGP SIGNATURE-----
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