I am newbie in C++ and I am trying to use lower_bound and upper_bound for sorting and searching vector. This line of code make strange error for me:
up = upper_bound(low, this->data.end(), name, [](const human & a, const string & b) {return (a.name < b) ? true : false;});
The error is no matching function call to object of type <lambda at ...
which is not fired on this line, but in algorithm library on line 4104. I am confused, because I am using upper_bound
in another part of code it works fine. Also when I changed the function from upper_bound
to lower_bound
everything works fine.
Does anyone has idea how to solve that?