absl::c_search_n

c_search_n overloads

Synopses

Declared in <absl/algorithm/container.h>

Container-based version of the <algorithm> std::search_n() function to search a container for the first sequence of N elements.

template<
    typename Sequence,
    typename Size,
    typename T>
constexpr
/* implementation-defined */
c_search_n(
    Sequence& sequence,
    Size count,
    T&& value);
» more...

Overload of c_search_n() for using a predicate evaluation other than == as the function's test condition.

template<
    typename Sequence,
    typename Size,
    typename T,
    typename BinaryPredicate>
constexpr
/* implementation-defined */
c_search_n(
    Sequence& sequence,
    Size count,
    T&& value,
    BinaryPredicate&& pred);
» more...

Return Value

An iterator to the beginning of the found run, or the end iterator if none is found.

Parameters

NameDescription
sequenceThe container to search.
countThe number of consecutive matching elements to search for.
valueThe value each of the consecutive elements must equal.
predThe binary predicate used to compare elements.