template<typename R, typename... Args>
class CoreFunction< R(Args...)>
Simplified version of the std::function object.
This can be used to store a lambda or any "callable" thing. It's used like std::function: ``` CoreFunction<bool (int)> function = [] (int a) { return (a % 2) == 0; }; function(3); ```
Note that like std::function, you need to be carefull with the lifetime of what you pass to it. For instance if you create a CoreFunction from a lambda, make sure that if the lambda captures stuff, you capture either by value, or that the reference captured objects won't be destoyed before the function is used.
template<typename R , typename... Args>
template<typename Functor >
Construct an instance from a "functor" (basically any callbale thing: a pointer to a static function, lambda, function object, etc.)
- Parameters
-
functor | The functor. Needs to have a copy constructor and a move constructor. |