If you have a pointer to a member function like so:
struct Foo { void func() {} };
void(Foo::*funcPtr)() = &Foo::func;
Is there a way to get the type of the function, with the Foo::
removed?
I.e.,
void(Foo::*)()
-> void(*)()
int(Foo::*)(int, double, float)
-> int(*)(int, double, float)
You get the idea.
The goal is to make std::function
accept a functor like this:
struct Functor { void operator()(...){} }
Functor f;
std::function< magic_get_function_type< decltype(Functor::operator()) >::type > stdfunc{f};
Is it possible?