https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97154
--- Comment #4 from David Binderman <dcb314 at hotmail dot com> --- According to this: http://www.cplusplus.com/reference/vector/vector/end/ Dereferencing end() is not allowed. Now I know why static analyser cppcheck was complaining.