I have the following problem:
vector<CPerson>toRemove;// has some objects that are contained in m_vObjects
vector<CPerson>m_vObjects;
for (auto it = toRemove.begin(); it != toRemove.end(); ++it)
{
for (auto iter = m_vObjects.begin(); iter != m_vObjects.end(); ++iter)
{
iter = m_vObjects.erase(it);
}
}
What I want to do is delete all the objects from m_vObjects
that are contained in toRemove
. I have tried a lot of stuff, but nothing worked fine.