How do we ususaly deal with a vector whose elements are pointers to object? My specific question is the comment at the end of the code supplied below. Thanks.
Use an array of shared_ptr, or similar smart pointer. And note that your base class must have a virtual destructor for this code to work correctly.