3#ifndef TETL_ALGORITHM_IS_SORTED_UNTIL_HPP
4#define TETL_ALGORITHM_IS_SORTED_UNTIL_HPP
6#include <etl/_functional/less.hpp>
11template <
typename ForwardIt,
typename Compare>
12[[nodiscard]]
constexpr auto is_sorted_until(ForwardIt first, ForwardIt last, Compare comp) -> ForwardIt
15 ForwardIt next = first;
16 while (++next != last) {
17 if (comp(*next, *first)) {
30template <
typename ForwardIt>
31[[nodiscard]]
constexpr auto is_sorted_until(ForwardIt first, ForwardIt last) -> ForwardIt
33 return etl::is_sorted_until(first, last,
etl::
less());
constexpr auto is_sorted_until(ForwardIt first, ForwardIt last) -> ForwardIt
Examines the range [first, last) and finds the largest range beginning at first in which the elements...
Definition is_sorted_until.hpp:31
constexpr auto is_sorted_until(ForwardIt first, ForwardIt last, Compare comp) -> ForwardIt
Definition is_sorted_until.hpp:12
Definition adjacent_find.hpp:9
Function object for performing comparisons. Unless specialised, invokes operator< on type T....
Definition less.hpp:15