Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/meta/function.hpp"
Helper for uniform access to function signature types.
Extract 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 pick up
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.This 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 on functor objects, 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 108 of file function.hpp.
Public Types | |
using | Functor = FUN |