upper_bound vs. lower_bound

Is it true that there is no practical difference between std::lower_bound and std::upper_bound if the sorted range has all unique values?
chsalviaAsked:
Who is Participating?
 
Infinity08Commented:
upper_bound returns the first value higher than a given value in a sorted series.
lower_bound returns the first value which is not less than a given value in a sorted series

        http://www.cplusplus.com/reference/algorithm/upper_bound.html
        http://www.cplusplus.com/reference/algorithm/lower_bound.html

So, in other words, lower_bound is equivalent to >=, while upper_bound is equivalent to >. ie. they're not exactly the same.
0
 
jkrCommented:
No. See the code samples and the output at http://www.sgi.com/tech/stl/upper_bound.html and http://www.sgi.com/tech/stl/lower_bound.html (scroll down a bit for the examples on both pages)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.