14#ifndef RANGES_V3_ALGORITHM_UPPER_BOUND_HPP
15#define RANGES_V3_ALGORITHM_UPPER_BOUND_HPP
27#include <range/v3/utility/static_const.hpp>
29#include <range/v3/detail/prologue.hpp>
35 RANGES_FUNC_BEGIN(upper_bound)
42 typename P = identity)(
43 requires forward_iterator<I> AND sentinel_for<S, I> AND
44 indirect_strict_weak_order<C, V
const *, projected<I, P>>)
45 constexpr I RANGES_FUNC(upper_bound)(
46 I
first, S last, V
const & val, C pred = C{}, P proj = P{})
48 return partition_point(std::move(first),
50 detail::make_upper_bound_predicate(pred, val),
55 template(
typename Rng,
typename V,
typename C =
less,
typename P = identity)(
56 requires forward_range<Rng> AND
57 indirect_strict_weak_order<C, V
const *, projected<iterator_t<Rng>, P>>)
58 constexpr borrowed_iterator_t<Rng> RANGES_FUNC(upper_bound)(
59 Rng && rng, V
const & val, C pred = C{}, P proj = P{})
61 return partition_point(
62 rng, detail::make_upper_bound_predicate(pred, val), std::move(proj));
65 RANGES_FUNC_END(upper_bound)
69 using ranges::upper_bound;
74#include <range/v3/detail/epilogue.hpp>
front< Pair > first
Retrieve the first element of the pair Pair.
Definition meta.hpp:2251
bool_<(T::type::value< U::type::value)> less
A Boolean integral constant wrapper around true if T::type::value is less than U::type::value; false,...
Definition meta.hpp:255