Other alternatives worth considering are to use boost::ptr_container, or even better, use a library like adobe::poly or boost::type_erasure for your polymorphic types, to exploit value-based run-time polymorphism—avoids the need for pointers, inheritance, etc.