|
| template<typename T_setter, typename T_getter> |
| compose1_functor< T_setter, T_getter > | sigc::compose (const T_setter & setter, const T_getter & getter) |
| | Creates an adaptor of type sigc::compose1_functor which combines two functors.
|
| template<typename T_setter, typename T_getter1, typename T_getter2> |
| compose2_functor< T_setter, T_getter1, T_getter2 > | sigc::compose (const T_setter & setter, const T_getter1 & getter1, const T_getter2 & getter2) |
| | Creates an adaptor of type sigc::compose2_functor which combines three functors.
|
sigc::compose() combines two or three arbitrary functors.
On invocation, parameters are passed on to one or two getter functor(s). The return value(s) are then passed on to the setter function.
- Examples:
float square_root(float a) { return sqrtf(a); }
float sum(
float a,
float b) {
return a+b; }
square_root(9))
compose1_functor< T_setter, T_getter > compose(const T_setter &setter, const T_getter &getter)
Creates an adaptor of type sigc::compose1_functor which combines two functors.
Definition compose.h:169
The functor that sigc::compose() returns can be passed directly into sigc::signal::connect() or sigc::signal::connect_first().
- Example:
sigc::signal(float(float, float)> some_signal;