An advantage other languages such as Python and Lisp/ Scheme, ML
and Haskell, etc., over C++ is the ability to have heterogeneous
containers that can hold arbitrary element types. All the
containers in the standard library can only hold a specific
type. A can only hold only hold elements of type and so on.
True, you can use inheritance to make the containers hold
different types, related through subclassing. However, you have
to hold the objects through a pointer or smart reference of some
sort. Doing this, you'll have to rely on virtual functions to
provide polymorphic behavior since the actual type is erased as
soon as you store a pointer to a derived class to a pointer to
its base. The held objects must be related: you cannot hold
objects of unrelated types such as etc. Oh sure you can use
something like Boost.Any to hold arbitrary types, but then you
pay more in terms of runtime costs and due to the fact that you
practically erased all type information, you'll have to perform
dangerous casts to get back t