MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / main

Function main

samples/invalidContainer/good.cpp:2–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include <vector>
2int main()
3{
4 std::vector<int> items;
5 items.push_back(1);
6 items.push_back(2);
7 items.push_back(3);
8 std::vector<int>::iterator iter;
9 for (iter = items.begin(); iter != items.end();) {
10 if (*iter == 2) {
11 iter = items.erase(iter);
12 } else {
13 ++iter;
14 }
15 }
16}

Callers

nothing calls this directly

Calls 4

push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected