21#ifndef RANGES_V3_ALGORITHM_SEARCH_N_HPP
22#define RANGES_V3_ALGORITHM_SEARCH_N_HPP
38#include <range/v3/utility/static_const.hpp>
41#include <range/v3/detail/prologue.hpp>
51 template<
typename I,
typename S,
typename D,
typename V,
typename C,
typename P>
52 constexpr subrange<I> search_n_sized_impl(I
const begin_,
61 auto first = uncounted(begin_);
70 auto e = ranges::next(recounted(begin_, std::move(first), d_ - d),
86 return {recounted(begin_, std::move(first), d_ - d),
87 recounted(begin_, std::move(++m), d_ - d)};
93 first = next(std::move(m));
101 template<
typename I,
typename S,
typename D,
typename V,
typename C,
typename P>
102 constexpr subrange<I> search_n_impl(I first,
135 first = next(std::move(m));
144 RANGES_FUNC_BEGIN(search_n)
156 iter_difference_t<I> cnt,
164 return detail::search_n_sized_impl(std::move(first),
166 distance(first, last),
172 return detail::search_n_impl(
173 std::move(first), std::move(last), cnt, val, pred, proj);
177 template(
typename Rng,
typename V,
typename C =
equal_to,
typename P =
identity)(
180 constexpr borrowed_subrange_t<Rng> RANGES_FUNC(search_n)(Rng && rng,
181 iter_difference_t<iterator_t<Rng>> cnt,
189 return detail::search_n_sized_impl(
190 begin(rng), end(rng), distance(rng), cnt, val, pred, proj);
192 return detail::search_n_impl(begin(rng), end(rng), cnt, val, pred, proj);
195 RANGES_FUNC_END(search_n)
199 using ranges::search_n;
204#include <range/v3/detail/epilogue.hpp>
The forward_iterator concept.
The forward_range concept.
The indirectly_comparable concept.
The sentinel_for concept.
The sized_sentinel_for concept.
decltype(begin(declval(Rng &))) iterator_t
Definition access.hpp:698
typename Fn::template invoke< Args... > invoke
Evaluate the invocable Fn with the arguments Args.
Definition meta.hpp:541
front< Pair > first
Retrieve the first element of the pair Pair.
Definition meta.hpp:2251
Definition adjacent_find.hpp:67
Definition comparisons.hpp:28
Definition identity.hpp:25
Definition subrange.hpp:196