As I can see, you alreadty hardcoded the number and types of parameters that class T should accept as a template parameter. Here you do not need variable templates. Just do it instead:
template < template<class, std::size_t> class T, class A, std::size_t N> class C { T<A, N> storage; }; int main(){ C<std::array, int, 3> c;
If you want to use custom templates, add it also to the template template:
template < template<typename...> class T, typename... Types> class C { T<Types...> storage; };
If you want to use this version, but want to use std::array , you can create an alias std::array that already has a size:
template<typename T> using array3 = std::array<T, 3>; C<array3, int> c;
Alternatively, you can also create an alias for the template template that allows you to select a size:
template<std::size_t n> struct sized_array { template<typename T> using array = std::array<T, n>; }; C<sized_array<5>::array, int>;
Guillaume racicot
source share