25 Algorithms library [algorithms]

25.4 Sorting and related operations [alg.sorting]

25.4.6 Heap operations [alg.heap.operations]

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

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

Requires: The range [first,last - 1) shall be a valid heap. The type of *first shall satisfy the MoveConstructible requirements (Table [moveconstructible]) and the MoveAssignable requirements (Table [moveassignable]).

Complexity: At most log(last - first) comparisons.