Is it possible to iterate in one single step through elements of a vector, while deleting some of the elements, to prevent repeated processing? (I know the fragment is bogus, but illustrates what I want)
std::vector<MyRecord*>* BLV = GetVector();
for (std::vector<MyRecord*>::iterator it = BLV->begin(); it != BLV->end(); ++it)
{
MyRecord* BL = *it;
if(Selected)
{
delete BL;
BLV->erase(it);
}
}