is_heap

Returns true if the elements in the specified range form a heap.

template<class RandomAccessIterator>
    bool is_heap(
        RandomAccessIterator _First,
        RandomAccessIterator _Last
    );
template<class RandomAccessIterator, class BinaryPredicate>
    bool is_heap(
        RandomAccessIterator _First,
        RandomAccessIterator _Last,
        BinaryPredicate _Comp
    ); 

_First

A random access iterator that indicates the start of a range to check for a heap.

_Last

A random access iterator that indicates the end of a range.

_Comp

A condition to test to order elements. A binary predicate takes a single argument and returns trueor false.

Returns true if the elements in the specified range form a heap, false if they do not.

The first template function returns is_heap_until(_First, _Last) == _Last.

The second template function returns

is_heap_until ( _First , _Last , _Comp ) == _Last.

Header: <algorithm>

Namespace: std

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft