Created
October 20, 2014 15:31
-
-
Save elliotpotts/66190b178d6fa1a32246 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T> | |
struct function_traits : public function_traits<decltype(&T::operator())>{ | |
}; | |
template <typename ClassType, typename ReturnType, typename... Args> | |
struct function_traits<ReturnType(ClassType::*)(Args...) const> { | |
static constexpr auto arity = sizeof...(Args); | |
typedef ReturnType result_type; | |
template <size_t i> | |
using arg = std::tuple_element_t<i, std::tuple<Args...>>; | |
using args = typename std::tuple<Args...>; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment