C++11 indexing template parameter packs at runtime in order to access Nth type
问题 From this SO topic (and this blog post), I know how to access Nth type in a template parameter pack. For instance, one of the answers to the abovementioned SO question suggests this: template<int N, typename... Ts> using NthTypeOf = typename std::tuple_element<N, std::tuple<Ts...>>::type; using ThirdType = NthTypeOf<2, Ts...>; However, these methods work only in compile-time. Trying to do something such as: int argumentNumber = 2; using ItsType = NthTypeOf<argumentNumber, Arguments...>; would