Namespaces
Variants
Views
Actions

Talk:cpp/algorithm/lower bound

From cppreference.com

>> The type Type1 must be such that an object of type T can be implicitly converted to Type1. The type Type2 must be such that an object of type ForwardIterator can be dereferenced and then implicitly converted to Type2. ​

I just tried to use lower_bound with a comparison function, libc++ as well as VS 2010 have this the other way around. I don't know where I would find the standard to check which way it's actually correct, but if 2 independent compilers agree I tend to believe that.

You are correct, thanks for pointing out the error. The std reference is §25.4.3.1[lower.bound] and the comparison function of course is called as comp(*j, value) --Cubbi 08:01, 9 May 2012 (PDT)