c++ - Is it possible to add some condition to `boost::signal` -
is possible add condition boost::signal
. may boolean function , when emit signal should check if function returns true emit.
i don't want check condition during emitting because emitted many places. don't want check condition in slot because should not know condition.
if need emit signal many places way, add method it:
void emitsignal() { if( /* condition */ ) { _signal(); } }
then call emitsignal()
instead of emitting signal directly.
Comments
Post a Comment