![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
#include "lib/meta/function.hpp"
Trait template for uniform access to function signature types.
Extracts the type information contained in a function or functor type, so it can be manipulated by metaprogramming. This template works on anything function like, irrespective if the parameter is given as function reference, function pointer, member function pointer, functor object, std::function or lambda. The embedded typedefs allow to expose
Ret : the return typeArgs: the sequence of argument types as type sequence Types<ARGS...>Sig : the bare function signature typeFunctor : corresponding Functor type which can be instantiated or copied.ARITY : number of argumentsThis template can also be used in metaprogramming with enable_if to enable some definition or specialisation only if a function-like type was detected; thus the base case holds no nested type definitions and inherits from std::false_type. The primary, catch-all case gets activated whenever used on functor objects proper, i.e. anything with an operator(). The following explicit specialisations handle the other cases, which are not objects, but primitive types (function (member) pointers and references).
decltype of operator() and was proposed 10/2011 by user «kennytm» in this stackoverflow. std::function, an additional first parameter will show up to take the this pointer of the class instance. operator()Definition at line 142 of file function.hpp.
Public Types | |
| using | Functor = FUN |
Definition at line 145 of file function.hpp.
Inheritance diagram for _Fun< FUN, SEL >:
Collaboration diagram for _Fun< FUN, SEL >: