What is the best way to store pointers in C++. The number of pointers is dynamic, so an array is not feasible. C++'s vector is not the obvious solution, as deleting anything off the vector would cause a memory leak. Subclassing vector to properly delete pointers is not feasible either, as vector's destructor is not virtual. Is there any other option to creating my own vector (a proper pain to do).