absl::c_contains

Container-based version of the <algorithm> std::ranges::contains() C++23 function to search a container for a value.

Synopsis

Declared in <absl/algorithm/container.h>

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

Return Value

true if value is found within sequence, otherwise false.

Parameters

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