This is from C++ Primer (5th edition); Ch 19. "Appendix: algorithms":
lower_bound(beg, end, val) lower_bound(beg, end, val, comp)Returns an iterator denoting the first element such that
valis not less than that element, orendif no such element exists.upper_bound(beg, end, val) upper_bound(beg, end, val, comp)Returns an iterator denoting the first element
- But I think
lower_boundreturns an iterator denoting the first element in the input sequence that is not less thanval(greater than or equal to val) not the contrary ("...first element such thatvalis not less than that element"). Is it a mistake in the book?