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; };
1.4m articles
1.4m replys
5 comments
57.0k users