I want to erase an element from the std::list
and then point back to this list but when I do it this way
for(std::list<CvRect>::iterator it = listOfCvRects.begin(); it != listOfCvRects.end(); it++)
{
for(std::list<CvRect>::iterator jt = listOfCvRects.begin(); jt != listOfCvRects.end(); jt++)
{
if( it == jt )
{ continue;}
if( (jt->x) > (it->x) //.. more conditions...)
{
jt = listOfCvRects.erase(jt);
//OR
//listOfCvRects.erase(jt++);
}
}
}
I got and unhandled exception : iterator is unincrementable