cppcheck complains about dereferencing iterators in an array of iterators:
#include <vector> std::vector<int>::const_iterator f() { const std::vector<int> v = {1, 2, 3, 4}; const std::vector<int>::const_iterator a[2] = { v.begin(), v.end() }; return *a[1]; }
Yields the error:
[test.cpp:7]: (error) The iterator 'a' is invalid before being assigned. Dereferencing or comparing it with another iterator is invalid operation.
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/13332
thanks!
Log in to post a comment.
cppcheck complains about dereferencing iterators in an array of iterators:
Yields the error:
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/13332
thanks!