is_increasing

Interface

template<typename ForwardIterator>
inline SPROUT_CONSTEXPR bool
is_increasing(ForwardIterator first, ForwardIterator last);

Returns

Same as is_sorted(first, last, less<>()).

Examples

#include <sprout/algorithm/is_increasing.hpp>
#include <sprout/array.hpp>
#include <sprout/container.hpp>
using namespace sprout;

SPROUT_STATIC_CONSTEXPR auto input = array<int, 10>{{1, 1, 2, 2, 3, 3, 4, 4, 5, 5}};
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_increasing(begin(input), end(input));
static_assert(result, "input is increasing.");

Complexity

Recursive function invocations in O(logN) (logarithmic) depth.

Table Of Contents

Previous topic

is_sorted_until

Next topic

is_decreasing

This Page