mercredi 24 février 2016

Map/iterator incremental error

The following code throwing debug assertion map/iterator incremental error ..

void ClassA::Remove()
{
    std::map<int, CVClassB*>::iterator it(m_p.begin());
    while ( it != m_p.end() )
    {
        if (it->first >= 0)
        {
            m_p.erase(it);
            it++;
        }   
    }
}

Can you please let me know what is the error

Aucun commentaire:

Enregistrer un commentaire