Testing a boost::signal
Hi,
What is the correct syntax to test whether a signal has any slots
connected?
boost::signal
if (!sig.empty())
doSomething();
But if you just want to "fire" your signal, you don't have to test its
emptiness.
2008/7/13, Simon Pickles
Hi,
What is the correct syntax to test whether a signal has any slots connected?
boost::signal
sig; if (sig) DoSomething();
This doesn't compile.
Thanks
Simon _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On Sunday 13 July 2008 07:21, Igor R wrote:
if (!sig.empty()) doSomething();
But if you just want to "fire" your signal, you don't have to test its emptiness.
Actually, if you have a non-void return type for the signal, the default combiner (boost::last_value) requires a slot to be connected.
participants (3)
-
Frank Mori Hess
-
Igor R
-
Simon Pickles