28 Algorithms library [algorithms]

28.7 Sorting and related operations [alg.sorting]

28.7.7 Heap operations [alg.heap.operations]

28.7.7.1 push_­heap [push.heap]

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 and the MoveAssignable requirements.

Effects: Places the value in the location last - 1 into the resulting heap [first, last).

Complexity: At most comparisons.