Compartilhar via


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
    ); 

Parameters

  • _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.

Return Value

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

Remarks

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

The second template function returns

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

Requirements

Header: <algorithm>

Namespace: std

See Also

Reference

is_heap_until

<algorithm>