absl::c_binary_search

Container-based version of the <algorithm> std::binary_search() function to test if any element in the sorted container contains a value equivalent to 'value'.

Synopsis

Declared in <absl/algorithm/container.h>

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

Return Value

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

Parameters

NameDescription
sequenceThe sorted container to search.
valueThe value to search for.