Skip to content

Instantly share code, notes, and snippets.

@xaxxon
Created January 20, 2016 05:29
Show Gist options
  • Save xaxxon/da00417a0dc23de967ea to your computer and use it in GitHub Desktop.
Save xaxxon/da00417a0dc23de967ea to your computer and use it in GitHub Desktop.
template<class T>
struct MethodTypesHelper{};
template<class RETURN_TYPE, class ... PARAMETERS>
struct MethodTypesHelper<RETURN_TYPE(*)(PARAMETERS...)>{
typedef RETURN_TYPE(*FUNCTION_TYPE)(PARAMETERS...);
std::function<RETURN_TYPE(PARAMETERS...)> operator()(FUNCTION_TYPE function) {
return std::function<RETURN_TYPE(PARAMETERS...)>(function);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment