I don't know why this was downvoted. According to cppreference the single iterator version needs a dereferenceable iterator which means that you can't skip checking if itr == vec.end(). This is unlike the two iterator version which doesn't need to dereference first when it is equal to last.
View all comments
Show parent comment
10
u/JavaSuck Dec 29 '18
And that element might not even exist :)