libycxx

function object

std::ranges::search_n

Scope
std::ranges

Synopsis

inline constexpr /* implementation-defined */ search_n = {};

Call signatures

search_n is a function object; these are its call operators as libycxx declares them, written as the functions the draft declares.

  1. template<
        std::ranges::forward_range R,
        class Pred = std::ranges::equal_to,
        class Proj = std::identity,
        class T = std::projected_value_t<iterator_t<R>, Proj>>
      requires std::indirectly_comparable<iterator_t<R>, const T*, Pred, Proj>
    [[nodiscard]] constexpr borrowed_subrange_t<R> search_n(
        R&& r,
        std::ranges::range_difference_t<R> count,
        const T& value,
        Pred pred = {},
        Proj proj = {});
    (1)
  2. template<
        std::forward_iterator I,
        std::sentinel_for<I> S,
        class Pred = std::ranges::equal_to,
        class Proj = std::identity,
        class T = std::projected_value_t<I, Proj>>
      requires std::indirectly_comparable<I, const T*, Pred, Proj>
    [[nodiscard]] constexpr std::ranges::subrange<I> search_n(
        I first,
        S last,
        std::iter_difference_t<I> count,
        const T& value,
        Pred pred = {},
        Proj proj = {});
    (2)
  3. template<
        class ExecutionPolicy,
        sized-random-access-range R,
        class Pred = std::ranges::equal_to,
        class Proj = std::identity,
        class T = std::projected_value_t<std::ranges::iterator_t<R>, Proj>>
      requires execution-policy<ExecutionPolicy> &&
                 std::indirectly_comparable<std::ranges::iterator_t<R>, const T*, Pred, Proj>
    decltype(auto) search_n(
        ExecutionPolicy&&,
        R&& r,
        std::ranges::range_difference_t<R> count,
        const T& value,
        Pred pred = {},
        Proj proj = {}) noexcept;
    (3)
  4. template<
        class ExecutionPolicy,
        std::random_access_iterator I,
        std::sized_sentinel_for<I> S,
        class Pred = std::ranges::equal_to,
        class Proj = std::identity,
        class T = std::projected_value_t<I, Proj>>
      requires execution-policy<ExecutionPolicy> && std::indirectly_comparable<I, const T*, Pred, Proj>
    decltype(auto) search_n(
        ExecutionPolicy&&,
        I first,
        S last,
        std::iter_difference_t<I> count,
        const T& value,
        Pred pred = {},
        Proj proj = {}) noexcept;
    (4)