absl::c_binary_search

Overload of c_binary_search() for performing a comp comparison other than the default operator<.

Synopsis

Declared in <absl/algorithm/container.h>

template<
    typename Sequence,
    typename T,
    typename LessThan>
constexpr
bool
c_binary_search(
    Sequence const& sequence,
    T const& value,
    LessThan&& comp);

Return Value

true if an element equivalent to value under comp exists, otherwise false.

Parameters

NameDescription
sequenceThe sorted container to search.
valueThe value to search for.
compThe comparison used to order the elements.