std :: vector :: reserve (100) will require 100 * sizeof (Foo) free memory, so further insertion into the vector will not allocate memory until 100 * sizeof (foo) is filled, but access to the element of this vector will give an indeterminate content of this element, since its only requirement is that memory does not allocate it.
source share