See also: function
class reference.
Model of
Description
The function class can be used to apply a function to an incoming signal and output the result. function is a _modifier_ with the Modifier set to an adapter for the provided function.
Example
signals::function<void (float), float(float)> double_fun1(boost::bind(std::multiplies<float>(), _1, 2.0f)); signals::function<void (float), float(float)> double_fun2(boost::bind(std::multiplies<float>(), _1, 2.0f)); signals::storage<void (float)> floater(1.0f); signals::storage<void (float)> collector(0.0f); floater >>= double_fun1 >>= double_fun2 >>= collector; floater.send(); BOOST_CHECK_EQUAL(collector.at<0>(), 4.0f);