I need to delete the vector of outer loop inside the inner loop.
for( std::vector<string>::iterator iter4 = LogList.begin(); iter4 != LogList.end(); ++iter4 )
{
string logfile = *iter4;
logfile.resize (logfile.size () - 4);
for( std::vector<string>::iterator iter5 = FileList.begin(); iter5 != FileList.end(); ++iter5 )
{
string file1 = *iter5;
if(logfile == file1)
{
LogList.erase(*iter4);//This is line..but show the error
}
}
}
It should be LogList.erase(iter4);
, but be careful because this will invalidate the iter4 iterator.
Last edited on