Template parameter pack attribute
c++, c++11, templates, variadic-templates
Solution
Using `std::tuple`, by example
#include <tuple>
template <int i>
class A
{ };
template <int... is>
class Pack
{ std::tuple<A<is>...> attrs; };
int main()
{
Pack<2,3,5,7,11,13> p;
}
Another way can be through inheritance
template <int i>
class A
{ };
template <int... is>
class Pack : A<is>...
{ };
int main()
{
Pack<2,3,5,7,11,13> p;
}
Problem
We have template class: ``` template<int i> class A { ... }; ``` But how to declare packer of template classes: ``` template<int... is> Pack { private: A<is...> attrs; }; ``` Or howto have collection of classes A?