by asveikau · 10y ago · 0 comments
Until you realize the purpose of the weird syntax in the former.
Namely: you can write algorithms where an iterator is a drop-in replacement for a simple loop through all items in an array via pointer arithmetic, if you write it to take a start and an end iterator as templates.
Plus said algorithm can take sub-ranges instead of requiring it to loop through all items.
I thought c++ iterators were very strange for many years until I understood this and other rationales.