The use of multiple outputs (signal producers) is not yet fully integrated with the filter class. Ideally, the filter class should allow you to specify more than one signal output signature, but that feature is not available yet.
In the meantime, multiple outputs can be achieved by introducing additional signals in the class:
class SignalOutIntFloat : public signals::filter<SignalOutIntFloat, void (float)> { public: SignalOutIntFloat(float x) : x(x) {} void operator()() { out(x); out_int((int)x); } boost::signal<void (int)> out_int; private: float x; }; // end class SignalOutIntFloat
You can then connect the signal directly:
SignalOutIntFloat multi_out(2.5f); signals::storage<void (float)> float_collector(0.0f); signals::storage<void (int)> int_collector(0); multi_out >>= float_collector; multi_out.out_int >>= int_collector; multi_out(); BOOST_CHECK_EQUAL(float_collector.at<0>(), 2.5f); BOOST_CHECK_EQUAL(int_collector.at<0>(), 2);