STL learning----lower_bound and upper_bound algorithms

The ForwardIter lower_bound(ForwardIter first, ForwardIter last, const _Tp& val) algorithm returns the first position in a non-decreasing sequence [first, last) that is greater than or equal to the value val.

The ForwardIter upper_bound(ForwardIter first, ForwardIter last, const _Tp& val) algorithm returns the first position in a non-decreasing sequence [first, last) greater than val.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325176865&siteId=291194637