Consider the error:
expected nested qualifier before "Ts"
This is due to what you wrote:
template< size_t... N_i, typename Ts... >
Instead:
template< size_t... N_i, typename... Ts >
However, if you fix it, the code will not compile.
This is because you cannot mix the two parameter packages in the way you did.
You must reorganize your code in order to somehow get them out of context.
As an example, you can use std::index_sequence and partial specialization:
#include <vector> #include <tuple> #include<functional> using namespace std; template< typename... > class A; template< size_t... N_i, typename... Ts > class A<index_sequence<N_i...>, Ts...> { // ... private: std::vector<size_t> _v = { N_i... }; std::tuple<Ts...> _t; }; int main() { A<index_sequence<1>> a; }
source share