I lately had some trouble with .lower_bound()
until i found out that it returns an iterator to the past-the-end element if no value fits the argument. The same for .end()
, which points to the past-the-end entry.
What's the use of the past-the-end element and why does it not just points to the very last element of the vector? E.g. to the element that .back()
returns?