#include <algorithm> iterator upper_bound( iterator start, iterator end, const TYPE& val ); iterator upper_bound( iterator start, iterator end, const TYPE& val, StrictWeakOrdering cmp );
The upper_bound() algorithm searches the ordered range [start,end) for the last location that val could be inserted without disrupting the order of the range.
If the strict weak ordering function object cmp is given, it is used to compare elements instead of the < operator.
upper_bound() runs in logarithmic time.