Using std::tuple
, using an 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 could be inheritance
template <int i> class A { }; template <int... is> class Pack : A<is>... { }; int main() { Pack<2,3,5,7,11,13> p; }
max66 source share