다음을 통해 공유


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.

요구 사항

헤더: <algorithm>

네임스페이스: std

참고 항목

참조

is_heap_until

<algorithm>