4#ifndef TETL_ALGORITHM_IS_SORTED_HPP
5#define TETL_ALGORITHM_IS_SORTED_HPP
7#include <etl/_algorithm/is_sorted_until.hpp>
13template <
typename ForwardIt>
14[[nodiscard]]
constexpr auto is_sorted(ForwardIt first, ForwardIt last) ->
bool
16 return etl::is_sorted_until(first, last) == last;
20template <
typename ForwardIt,
typename Compare>
21[[nodiscard]]
constexpr auto is_sorted(ForwardIt first, ForwardIt last, Compare comp) ->
bool
23 return etl::is_sorted_until(first, last, comp) == last;
constexpr auto is_sorted(ForwardIt first, ForwardIt last) -> bool
Checks if the elements in range [first, last) are sorted in non-descending order.
Definition is_sorted.hpp:14
constexpr auto is_sorted(ForwardIt first, ForwardIt last, Compare comp) -> bool
Definition is_sorted.hpp:21
Definition adjacent_find.hpp:9