devxlogo

February 24, 1999

A vector<Base> Should Not Store Derived Objects

A vector stores its elements contiguously in memory (although this is not a requirement in the Standard, in practice, all implementations use contiguous storage). Consequently, each element in a vector