#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. | |
| virtual Callable * | clone () const=0 |
| Returns a copy of this instance. More... | |
| virtual R | call (As... args) const=0 |
| Calls the callable entity and returns its result. More... | |
| R | operator() (As... args) const |
| Same as call(). | |
Related Functions | |
| ConstMethod< R, ClassT, As... > | callable (ClassT &object, R(BaseT::*method)(As...) const) |
| Returns a ConstMethod object for the given object/method pair. | |
| Function< R, As... > | callable (R(*function)(As...)) |
| Returns a Function wrapper for the given free/static function. | |
| Method< R, ClassT, As... > | callable (ClassT &object, R(BaseT::*method)(As...)) |
| 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.
|
pure virtualinherited |
A copy of the instance is created with new is returned. Ownership is transfered to the caller, who has to delete it.
|
pure virtualinherited |
This is the primary non-virtual entry point used by Delegate and other callers that need the return value. All derived classes must implement this.
|
pure virtualinherited |
The passed arguments must match the template parameters.
Implements Invokable< As... >.