I have a vector of classes. How do I safely delete an item in the vector so the destructor gets called.
At the moment I have the following. But I suspect this is a 'brute force' removal.
How do I call 'delete' properly?
for(it=VectorAsset.begin();it<VectorAsset.end();it++)
{
if(szNameOrType==it->szName||szNameOrType==it->szType)
{
//delete it; // <<< wont compile
VectorAsset.erase(it);
}
}
Any help would be awesome