1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2024-11-12 21:09:01 +00:00
Sprout/source/libs/sprout/algorithm/is_increasing.rst

43 lines
1.2 KiB
ReStructuredText
Raw Normal View History

2013-08-22 07:53:23 +00:00
.. _sprout-algorithm-is_increasing:
###############################################################################
is_increasing
###############################################################################
Interface
========================================
.. sourcecode:: c++
template<typename ForwardIterator>
inline SPROUT_CONSTEXPR bool
is_increasing(ForwardIterator first, ForwardIterator last);
Returns
========================================
| Same as ``is_sorted(first, last, less<>())``.
Examples
========================================
.. sourcecode:: c++
#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.
Header
========================================
| ``sprout/algorithm/is_increasing.hpp``
| Convenience header: ``sprout/algorithm.hpp``