Defined in header <algorithm> template< class RandomIt >
bool is_heap( RandomIt first, RandomIt last ); (1) (since C++11) template< class RandomIt, class Compare >
bool is_heap( RandomIt first, RandomIt last, Compare comp ); (2) (since C++11)
Checks if the elements in range [first, last) are a max heap.
The first version of is_heap uses operator< to compare elements, whereas the second uses the given comparison function comp.
Parameters
first, last