Last active
November 6, 2020 07:03
-
-
Save tripulse/cb84bdb9930e26c18eef0fe25c9493ab 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
#include <cinttypes> | |
#include <tuple> | |
template<class> | |
struct function_traits {}; | |
template<class R, class... Args> | |
struct function_traits<R(Args...)> { | |
typedef R ret_t; | |
typedef std::tuple<Args...> args_t; | |
std::size_t n_args = std::tuple_size<args_t>::value; | |
typedef std::tuple< | |
std::remove_cv_t< | |
std::remove_reference_t< | |
std::remove_pointer_t< | |
std::remove_all_extents_t<Args>>>>...> args_pure_t; | |
template<std::size_t N> | |
struct arg { typedef std::tuple_element_t<N, args_t> type; }; | |
template<std::size_t N> | |
using arg_t = typename arg<N>::type; | |
template<std::size_t N> | |
struct arg_pure { typedef std::tuple_element_t<N, args_pure_t> type; }; | |
template<std::size_t N> | |
using arg_pure_t = typename arg_pure<N>::type; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't know what the fuck is this '-'