upper_bound(v.begin(), v.end(), val); Returns an iterator pointing to the first element in the range [first,last) which compares greater than val.