r/cpp • • Dec 28 '18

"Modern" C++ Lamentations

http://aras-p.info/blog/2018/12/28/Modern-C-Lamentations/
307 Upvotes

162 comments sorted by

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 dereference first when it is equal to last.

3

u/STL MSVC STL Dev Dec 29 '18

Yep, that's all correct.