is_heap_until

Returns true if the specified range forms a heap until the last element.

template<class RandomAccessIterator>
    bool is_heap_until(
        RandomAccessIterator _First, 
        RandomAccessIterator _Last
);
template<class RandomAccessIterator, class BinaryPredicate> 
    bool is_heap_until(
        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

The condition to test for. This is provided by a user-defined predicate function object that defines the condition to be satisfied by the element being searched for. A predicate takes a single argument and returns true or false.

Returns true if the specified range forms a heap until the last element, false if it doesn't.

The first template function returns the last iterator next in [_First, _Last) such that [_First, next) is a heap ordered by operator< or by _Comp. If _Last - _First < 2, then the function returns _Last.

The second template function behaves the same, except that it replaces operator<(X, Y) with _Comp(X, Y).

Header: <algorithm>

Namespace: std

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