Also to note that end() returns an iterator to the index after the last element.
The whole point of the iterator is to traverse a container. You are not guaranteed an iterator to be able to use <, >, <=, >= so without end() returning the index after the last element it is impossible to access the last element.