binary search
cppreference std::binary_search
Possible implementation
See also the implementations in libstdc++ and libc++.
template<class ForwardIt, class T>
bool binary_search(ForwardIt first, ForwardIt last, const T& value)
{
first = std::lower_bound(first, last, value);
return (!(first == last) && !(value < *first));
}