4#ifndef TETL_ALGORITHM_LOWER_BOUND_HPP
5#define TETL_ALGORITHM_LOWER_BOUND_HPP
7#include <etl/_functional/less.hpp>
8#include <etl/_iterator/advance.hpp>
9#include <etl/_iterator/distance.hpp>
10#include <etl/_iterator/iterator_traits.hpp>
21template <
typename ForwardIt,
typename T,
typename Compare>
22[[nodiscard]]
constexpr auto lower_bound(ForwardIt first, ForwardIt last, T
const& value, Compare comp)
noexcept
29 count =
etl::distance(first, last);
34 etl::advance(it, step);
35 if (comp(*it, value)) {
47template <
typename ForwardIt,
typename T>
48[[nodiscard]]
constexpr auto lower_bound(ForwardIt first, ForwardIt last, T
const& value)
noexcept -> ForwardIt
50 return etl::lower_bound(first, last, value,
less());
constexpr auto lower_bound(ForwardIt first, ForwardIt last, T const &value, Compare comp) noexcept -> ForwardIt
Returns an iterator pointing to the first element in the range [first, last) that is not less than (i...
Definition lower_bound.hpp:22
constexpr auto lower_bound(ForwardIt first, ForwardIt last, T const &value) noexcept -> ForwardIt
Definition lower_bound.hpp:48
Definition adjacent_find.hpp:9
iterator_traits is the type trait class that provides uniform interface to the properties of LegacyIt...
Definition iterator_traits.hpp:48
Function object for performing comparisons. Unless specialised, invokes operator< on type T....
Definition less.hpp:15