We will examine three different solutions to this problem, all in the context of C++. The first is having containers maintain elements derived from a common ancestor class. The second is to have containers that maintain pointers, which can be cast to the appropriate type. And the third alternative is to use templates. The template solution is nowdays taken to be the best alternative, at least in the C++ world.