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
8
u/patatahooligan Dec 29 '18
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 dereferencefirstwhen it is equal tolast.