How to forward constructor parameters to a contained tuple when one of the tuple elements has a default constructor and another one doesn’t
I am trying to write a class that uses a std::tuple
to store a bunch of objects with potentially different types. If the elements all have ctors that take some parameter, I can initialize the tuple from the container’s ctor correctly. However, if one of the elements only has a default ctor and the others do not, I am unable to construct the tuple. I get a compilation error.
Extract container template for storing a different type
Given a container of a certain type as input, is it possible to “extract” the container template and instantiate it for a different type? For example: