template <RandomAccessIterator I, Sentinel<I> S, class Comp = less<>,
class Proj = identity>
requires Sortable<I, Comp, Proj>
I pop_heap(I first, S last, Comp comp = Comp{}, Proj proj = Proj{});
template <RandomAccessRange Rng, class Comp = less<>, class Proj = identity>
requires Sortable<iterator_t<Rng>, Comp, Proj>
safe_iterator_t<Rng>
pop_heap(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{});
Requires: The range [first,last) shall be a valid non-empty heap.
Effects: Swaps the value in the location first with the value in the location last - 1 and makes [first,last - 1) into a heap.
Returns: last
Complexity: At most 2 * log(last - first) applications of the comparison function and projection.