Comment Re:Do it yourself (Score 1) 78
Cppcheck apparently knows "hundreds of other rules covering a multitude of language aspects" so you don't "have to mentally apply against every single line of code you write."
Cppcheck doesn't flag anything in Waffle Iron's example.
It also doesn't find anything wrong with:
std::vector<int> vec = {1, 2, 3, 4, 5};
auto it = vec.begin();
vec.push_back(6);
std::cout << *it << std::endl;
Which is another common example of how you can write memory errors without using C++ pointers.