#include <FXGenericTools.h>
Use as follows:
class Test { int *foo(double); }; // Need to convert the function pointer into a function pointer type // using template argument deduction template<typename fn> void GetFnInfo(fn funcPtr) { typedef FX::Generic::FnInfo<fn> fooInfo; typedef fooInfo::resultType result; // result becomes "int *" typedef fooInfo::objectType object; // object becomes "class Test" typedef fooInfo::par1Type par1; // par1 becomes "double" } ... GetFnInfo(&Test::foo);
If the function pointer type is not a pointer to code, arity becomes -1 and resultType becomes the type passed as template parameter.
Public Types | |
typedef fn | resultType |
typedef NullType | objectType |
typedef TL::create< resultType > ::value | asList |
Static Public Attributes | |
static const bool | isConst |
static const int | arity |