Dynamic-sized heterogenous containers

As seen in the preceding section, std::tuple is a heterogenous container with a fixed size and fixed element positions, more or less, like a regular struct but without named member variables.

How can we expand upon this to create a container with a variable size (such as std::vector, std::list, and so on) but with the ability to store different types? As the size of the container changes at runtime, we cannot use compile-time programming to generate code.

Get C++ High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.