#include <Pt/Lambda.h>
Adapts a lambda or function object as a callable. More...
Inherits Callable< R, A... >.
Public Member Functions | |
| template<typename T > | |
| Lambda (T &&lambda) | |
| Constructs from a lambda or function object. | |
| R | operator() (A... args) const |
| Call the callable entity. More... | |
| virtual Callable * | clone () const=0 |
| Returns a copy of this instance. More... | |
| R | call (A...) const |
| Same as operator(). | |
| void | invoke (A...) const |
| Invoke the callable entity. More... | |
Related Functions | |
| ConstMethod< R, C, ARGS > | callable (C &obj, R(BaseT::*ptr)(ARGS) const) |
| Returns a ConstMethod object for the given object/method pair. | |
| Function< R, ARGS > | callable (R(*func)(ARGS)) |
| Returns a Function wrapper for the given free/static function. | |
| Method< R, ClassT, ARGS > | callable (ClassT &obj, R(BaseT::*ptr)(ARGS)) |
| Returns a Method object for the given object/method pair. | |
The callable is stored by value and must therefore be copyable. For a non-generic lambda, the factory derives the Callable interface from operator(). Generic lambdas require an explicitly supplied signature.
|
virtual |
Since this class template is partially specialized, the passed arguments ARGUMENTS must match the template parameters.
Implements Callable< R, A... >.
|
pure virtualinherited |
A copy of the instance is created with new is returned. Ownership is transfered to the caller, who has to delete it.
|
virtualinherited |
Inherited from Invokable. Ignores the return value of the Callable. Since this class template is partially specialized, the passed arguments ARGUMENTS must match the template parameters.
Implements Invokable< A... >.