|
| Function () |
| Empty constructor (implementation will become null) More...
|
|
| Function (FunctionImpl< R, A, B, C > *impl) |
| Constructor with given Impl. More...
|
|
| Function (icl::utils::SmartPtr< FunctionImpl< R, A, B, C > >impl) |
| Constructor with given SmartPtr<Impl> More...
|
|
| Function (R(*global_function)(A, B, C)) |
| Constructor from given global function (for implicit conversion) More...
|
|
R | operator() (A a, B b, C c) const |
| function operator (always const) More...
|
|
| operator bool () const |
| checks wheter the implemnetation is not null More...
|
|
| operator Function< R, A, B, C > () const |
|
template<class R = void, class A = NO_ARG, class B = NO_ARG, class C = NO_ARG>
struct icl::utils::Function< R, A, B, C >
The General Function Template.
The Function class can be used as a generic functor that can have one of these backends:
- A global function call
- A member function call
- A call to an objects function operator (i.e. it wrapps a functor)
- An arbitrary implementation by wrapping a custom implementation of FunctionImpl<R,A,B>
This class should not be used directly! Use the overloaded icl::utils::function - template instead. Functions can be copied as objects. Internally, a SmartPointer is used to manage the actual function implementation.
The Function class template is specialized for functions with less than two parameters. In this case the Function's function-operator() also has less parameters.
- See also
- FUNCTION_SECTION
template<class R = void, class A = NO_ARG, class B = NO_ARG, class C = NO_ARG>
Constructor from given global function (for implicit conversion)
This constructor can be used for implicit conversion. Where a Function<R,A,B> is expected, you can simply pass a global function of type R(*function)(A,B)