For the sake of clarity, I\'ve removed things like the constructor & destructor etc from the below where they don\'t add anything to the question. I have a base class t
You've got your ellipsis in the wrong place. Try:
template class... Args>
^^^ here
However, you don't actually want template template parameters; since DerivedSystem1<1> is a type, not a template, you just want ordinary typename parameters:
template
class ContainerClass {
For the actual container, you can't use vector as that is homogeneous and will slice the derived types down to PeripheralSystem. If you add a virtual destructor to PeripheralSystem you can use vector:
template
class ContainerClass {
public:
ContainerClass() : container{std::make_unique()...} {}
std::vector> container;
};
However, tuple would work just as well and result in fewer allocations:
template
class ContainerClass {
public:
ContainerClass() : container{Args{}...} {}
std::tuple container;
};