22#ifndef RANGES_V3_ALGORITHM_PARTITION_POINT_HPP
23#define RANGES_V3_ALGORITHM_PARTITION_POINT_HPP
39#include <range/v3/utility/static_const.hpp>
41#include <range/v3/detail/prologue.hpp>
48 RANGES_FUNC_BEGIN(partition_point)
51 template(
typename I,
typename S,
typename C,
typename P =
identity)(
54 constexpr I RANGES_FUNC(partition_point)(I
first, S last, C pred, P proj = P{})
58 auto len = distance(first, std::move(last));
59 return aux::partition_point_n(
60 std::move(first), len, std::move(pred), std::move(proj));
65 auto len = iter_difference_t<I>{1};
69 auto d = advance(mid, len, last);
73 return aux::partition_point_n(
74 std::move(first), len, ranges::ref(pred), ranges::ref(proj));
76 first = std::move(mid);
82 template(
typename Rng,
typename C,
typename P =
identity)(
85 constexpr borrowed_iterator_t<Rng>
86 RANGES_FUNC(partition_point)(Rng && rng, C pred, P proj = P{})
90 auto len = distance(rng);
91 return aux::partition_point_n(
92 begin(rng), len, std::move(pred), std::move(proj));
94 return (*
this)(begin(rng), end(rng), std::move(pred), std::move(proj));
97 RANGES_FUNC_END(partition_point)
101 using ranges::partition_point;
106#include <range/v3/detail/epilogue.hpp>
The forward_iterator concept.
The forward_range concept.
The indirect_unary_predicate 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 identity.hpp:25