sigc::compose() combines two or three arbitrary functors.
More...
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 sum(
float a,
float b) {
return a+b; }
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:171
decltype(auto) ptr_fun(T_return(*func)(T_args...))
Creates a functor of type sigc::pointer_functor which wraps an existing non-member function.
Definition ptr_fun.h:109
The functor that sigc::compose() returns can be passed directly into sigc::signal::connect() or sigc::signal::connect_first().
- Example:
-
◆ compose() [1/2]
Creates an adaptor of type sigc::compose1_functor which combines two functors.
- Parameters
-
setter | Functor that receives the return value of the invocation of getter. |
getter | Functor to invoke from operator()(). |
- Returns
- Adaptor that executes setter with the value returned from invocation of getter.
◆ compose() [2/2]
Creates an adaptor of type sigc::compose2_functor which combines three functors.
- Parameters
-
setter | Functor that receives the return values of the invocation of getter1 and getter2. |
getter1 | Functor to invoke from operator()(). |
getter2 | Functor to invoke from operator()(). |
- Returns
- Adaptor that executes setter with the values return from invocation of getter1 and getter2.