Defined in header <algorithm> template< class ForwardIt >
bool is_sorted( ForwardIt first, ForwardIt last ); (1) (since C++11) template< class ForwardIt, class Compare >
bool is_sorted( ForwardIt first, ForwardIt last, Compare comp ); (2) (since C++11)
Checks if the elements in range [first, last) are sorted in ascending order. The first version of the function uses operator< to compare the elements, the second uses the given comparison function comp.