danmar/cppcheck — comment on commit 433f4640a9639eefb3270ce51619055230605b17
File: cli/cppcheckexecutor.cpp line 110
By danmar:

No I don't like that neither.

Using iterator or index doesn't matter much for me. But if you want to use index then I would change:

for (std::vector::size_type i = 0 ; i < ignored.size(); ++i) {

to:

for (std::size_type i = 0 ; i < ignored.size();) {

And then in the loop body increment the index if you don't erase the item:

if (somecondition)
erase..
else
++i;

If you increment even though an item is erased then the item after an erased item will always skipped.