std::vector<Pie> PtrPie;
Pie* ptr1 = new Pie;
PtrPie.push_back(ptr1);
delete *(PtrPie.begin() + index); // deletes Pie, index is the position of the ptr, this would be 0 in this example
PtrPie.erase(PtrPie.begin() + index); // and this removes the ptr from the vector
imagine Pie and index are defined somewhere.
I'm I doing it right? deleting (what I think is) Pie by dereferencing the iterator to the pointer in the vector, and then removing the pointer from the vector.