I was looking at how the upper bound and lower bound algorithms operate in stl on these pages: lower bound, upper bound, and it's documented the same way on these pages: lower bound, upper bound, and it's documented the same way on these pages: lower bound, upper bound, and it'
upper bound, lower bound
Looking at the code from the links, they appear to perform the same thing to me, with the exception of the following lines
lower_bound (line 10):
if (*it<val) { // or: if (comp(*it,val)), for version (2)
upper_bound (line 10):
if (!(val<*it)) // or: if (!comp(val,*it)), for version (2)
But isn't it true that inverting the compared elements and then comparing them to false is a double negative, and so they do the same thing?
Is there a distinction that I'm missing, or is this an error in the online documentation?
If the latter, what is the proper procedure?