Consider the following program
struct slot {
int item;
bool operator
return item < right;
}
slot(int item) : item(item) {}
};
int main() {
std::vector rails;
std::lower_bound(cbegin(rails), cend(rails), 5);
std::upper_bound(cbegin(rails), cend(rails), 5);
}
I am using std::upper_bound to binary search a vector but fails while compiling
c:\program files (x86)\microsoft visual studio 14.0\vc\include\algorithm(2609): error C2672: 'operator __surrogate_func': no matching overloaded function found
Considering the fact that std::upperbound uses operator< for implicit comparison without using a predicate, I cannot find a justified reason for the compiler to complain. Moreover, the error message is not quite meaningful as I do not see a reason for usin