All algorithms take a pair of iterators, where the first one points to the first element in the range and the second one points to one element beyond the last element in the range. Take a look at the following code snippet:
auto vec=std::vector<std::string>{ "a","b","c","d","e","f"};auto first = vec.begin();auto last = vec.end(); |
As seen in the image, the last iterator now points to an imagined element after "f":