I think the code will better illustrate my need:
template <typename F> struct return_type { typedef ??? type; };
so that:
return_type<int(*)()>::type -> int return_type<void(*)(int,int)>::type -> void
I know decltype and result_of , but they must have arguments. I want to infer the return type of a function pointer from a single template parameter. I cannot add the return type as a parameter, because exactly what I want to hide here ...
I know that there is a solution in boost, but I canβt use it, and trying to dig it out of boost led to an impressive crash (as is often the case).
C ++ 11 solutions are welcome (as long as they are supported in VS2012).
c ++ c ++ 11 function-pointers
Kornel kisielewicz
source share