3#ifndef TETL_ALGORITHM_UPPER_BOUND_HPP
4#define TETL_ALGORITHM_UPPER_BOUND_HPP
23template <
typename ForwardIt,
typename T,
typename Compare>
24[[nodiscard]]
constexpr auto upper_bound(ForwardIt first, ForwardIt last, T
const& value, Compare comp) -> ForwardIt
29 auto step =
count / 2;
31 if (not comp(value, *it)) {
42template <
typename ForwardIt,
typename T>
43[[nodiscard]]
constexpr auto upper_bound(ForwardIt first, ForwardIt last, T
const& value) -> ForwardIt
constexpr auto count(InputIt first, InputIt last, T const &value) -> typename iterator_traits< InputIt >::difference_type
Returns the number of elements in the range [first, last) satisfying specific criteria....
Definition count.hpp:21
constexpr auto upper_bound(ForwardIt first, ForwardIt last, T const &value, Compare comp) -> ForwardIt
Returns an iterator pointing to the first element in the range [first, last) that is greater than val...
Definition upper_bound.hpp:24
constexpr auto advance(It &it, Distance n) -> void
Increments given iterator it by n elements.
Definition advance.hpp:22
constexpr auto distance(It first, It last) -> typename iterator_traits< It >::difference_type
Returns the number of hops from first to last.
Definition distance.hpp:16
Definition adjacent_find.hpp:8
Function object for performing comparisons. Unless specialised, invokes operator< on type T....
Definition less.hpp:14