21#ifndef RANGES_V3_ALGORITHM_SEARCH_HPP
22#define RANGES_V3_ALGORITHM_SEARCH_HPP
38#include <range/v3/utility/static_const.hpp>
41#include <range/v3/detail/prologue.hpp>
51 template<
typename I1,
typename S1,
typename D1,
typename I2,
typename S2,
52 typename D2,
typename C,
typename P1,
typename P2>
53 constexpr subrange<I1> search_sized_impl(I1
const begin1_,
64 auto begin1 = uncounted(begin1_);
74 ranges::next(recounted(begin1_, std::move(begin1), d1_ - d1),
91 return {recounted(begin1_, std::move(begin1), d1_ - d1),
92 recounted(begin1_, std::move(++m1), d1_ - d1)};
110 template<
typename I1,
typename S1,
typename I2,
typename S2,
typename C,
111 typename P1,
typename P2>
112 constexpr subrange<I1> search_impl(I1 begin1,
127 return {begin1, begin1};
139 return {begin1, ++m1};
158 RANGES_FUNC_BEGIN(search)
161 template(
typename I1,
180 return {begin1, begin1};
183 return detail::search_sized_impl(std::move(begin1),
185 distance(begin1, end1),
188 distance(begin2, end2),
193 return detail::search_impl(std::move(begin1),
203 template(
typename Rng1,
210 constexpr borrowed_subrange_t<Rng1> RANGES_FUNC(search)(
211 Rng1 && rng1, Rng2 && rng2, C pred = C{}, P1 proj1 = P1{}, P2 proj2 = P2{})
216 return detail::search_sized_impl(begin(rng1),
226 return detail::search_impl(
227 begin(rng1), end(rng1), begin(rng2), end(rng2), pred, proj1, proj2);
230 RANGES_FUNC_END(search)
234 using ranges::search;
239#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
bool_< 0==size< L >::type::value > empty
An Boolean integral constant wrapper around true if L is an empty type list; false,...
Definition meta.hpp:2231
Definition adjacent_find.hpp:67
Definition comparisons.hpp:28
Definition identity.hpp:25
Definition subrange.hpp:196