How to get the Nth type of variadic template templates? For example
template<typename... Args> class MyClass { Args[0] mA; // This is wrong. How to get the type? };
You can use std::tuple:
std::tuple
#include<tuple> template<typename... Args> class MyClass { typename std::tuple_element<0, std::tuple<Args...> >::type mA; };
2.1m questions
2.1m answers
60 comments
57.0k users