
9 Sep
2003
9 Sep
'03
5:35 p.m.
Boost gurus, I am using boost::bind in combination with boost::signals for a GUI toolkit. The signals return bool for convenience, but it is often desireable to bind a void function and connect it to a signal. Is there a convenient way to assign a return value for a void function. As an example: ----------------------------------------------------------------- struct panel { void print() { std::cout << "print" << std::endl; } } struct widget { boost::signal<bool ()> on_event; } panel p; widget w; // is there some way to do something like this? w.on_event.connect(boost::bind_return(panel::print, &p, true)); ----------------------------------------------------------------- Many thanks in advance, Darren Hart