template<class RandomAccessIterator>
void push_heap(RandomAccessIterator first, RandomAccessIterator last);
template<class RandomAccessIterator, class Compare>
void push_heap(RandomAccessIterator first, RandomAccessIterator last,
Compare comp);
Requires:
The range
[first, last - 1)
shall be a valid heap
. The type of
*first shall satisfy
the
MoveConstructible requirements
(Table
23) and the
MoveAssignable requirements
(Table
25)
.Effects:
Places the value in the location
last - 1
into the resulting heap
[first, last). Complexity:
At most
comparisons
. template<class RandomAccessIterator>
void pop_heap(RandomAccessIterator first, RandomAccessIterator last);
template<class RandomAccessIterator, class Compare>
void pop_heap(RandomAccessIterator first, RandomAccessIterator last,
Compare comp);
Requires:
The range
[first, last)
shall be a valid non-empty heap
. The type
of
*first shall satisfy the requirements of
MoveConstructible (Table
23) and of
MoveAssignable (Table
25)
.Effects:
Swaps the value in the location
first
with the value in the location
last - 1
and makes
[first, last - 1)
into a heap
. Complexity:
At most
comparisons
. template<class RandomAccessIterator>
void make_heap(RandomAccessIterator first, RandomAccessIterator last);
template<class RandomAccessIterator, class Compare>
void make_heap(RandomAccessIterator first, RandomAccessIterator last,
Compare comp);
Requires: The type of
*first shall satisfy
the
MoveConstructible requirements
(Table
23) and the
MoveAssignable requirements
(Table
25)
. Effects:
Constructs a heap out of the range
[first, last). Complexity:
At most
comparisons
. template<class RandomAccessIterator>
void sort_heap(RandomAccessIterator first, RandomAccessIterator last);
template<class RandomAccessIterator, class Compare>
void sort_heap(RandomAccessIterator first, RandomAccessIterator last,
Compare comp);
Requires: The range
[first, last) shall be a valid heap
. The type
of
*first shall satisfy the requirements of
MoveConstructible (Table
23) and of
MoveAssignable (Table
25)
.Effects:
Sorts elements in the heap
[first, last). Complexity:
At most
comparisons, where
. template<class RandomAccessIterator>
bool is_heap(RandomAccessIterator first, RandomAccessIterator last);
Returns: is_heap_until(first, last) == last
template<class ExecutionPolicy, class RandomAccessIterator>
bool is_heap(ExecutionPolicy&& exec,
RandomAccessIterator first, RandomAccessIterator last);
Returns: is_heap_until(std::forward<ExecutionPolicy>(exec), first, last) == last
template<class RandomAccessIterator, class Compare>
bool is_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp);
Returns: is_heap_until(first, last, comp) == last
template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
bool is_heap(ExecutionPolicy&& exec,
RandomAccessIterator first, RandomAccessIterator last, Compare comp);
Returns:
is_heap_until(std::forward<ExecutionPolicy>(exec), first, last, comp) == last
template<class RandomAccessIterator>
RandomAccessIterator is_heap_until(RandomAccessIterator first, RandomAccessIterator last);
template<class ExecutionPolicy, class RandomAccessIterator>
RandomAccessIterator is_heap_until(ExecutionPolicy&& exec,
RandomAccessIterator first, RandomAccessIterator last);
template<class RandomAccessIterator, class Compare>
RandomAccessIterator is_heap_until(RandomAccessIterator first, RandomAccessIterator last,
Compare comp);
template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
RandomAccessIterator is_heap_until(ExecutionPolicy&& exec,
RandomAccessIterator first, RandomAccessIterator last,
Compare comp);
Returns: If
(last - first) < 2, returns
last. Otherwise, returns
the last iterator
i in
[first, last] for which the
range
[first, i) is a heap
.