2#ifndef TETL_ALGORITHM_IS_SORTED_UNTIL_HPP
3#define TETL_ALGORITHM_IS_SORTED_UNTIL_HPP
10template <
typename ForwardIt,
typename Compare>
11[[nodiscard]]
constexpr auto is_sorted_until(ForwardIt first, ForwardIt last, Compare comp) -> ForwardIt
14 ForwardIt
next = first;
15 while (++
next != last) {
16 if (comp(*
next, *first)) {
29template <
typename ForwardIt>
30[[nodiscard]]
constexpr auto is_sorted_until(ForwardIt first, ForwardIt last) -> ForwardIt
constexpr auto is_sorted_until(ForwardIt first, ForwardIt last, Compare comp) -> ForwardIt
Definition is_sorted_until.hpp:11
constexpr auto next(InputIt it, typename iterator_traits< InputIt >::difference_type n=1) -> InputIt
Return the nth successor of iterator it.
Definition next.hpp:14
Definition adjacent_find.hpp:8
Function object for performing comparisons. Unless specialised, invokes operator< on type T....
Definition less.hpp:14