Using non-const expression as template parameter
This is a follow up on How do I get the argument types of a function pointer in a variadic template class? I have this struct to access the arguments of a variadic template: template<typename T> struct function_traits; template<typename R, typename ...Args> struct function_traits<std::function<R(Args...)>> { static const size_t nargs = sizeof...(Args); typedef R result_type; template <size_t i> struct arg { typedef typename std::tuple_element<i, std::tuple<Args...>>::type type; }; }; And I access the type of an argument of Args with typedef function<void(Args...)> fun; std::cout << std::is