11 Algorithms library [algorithms]

11.5 Sorting and related operations [alg.sorting]

11.5.6 Heap operations [alg.heap.operations]

11.5.6.3 make_heap [make.heap]

template <RandomAccessIterator I, Sentinel<I> S, class Comp = less<>, class Proj = identity> requires Sortable<I, Comp, Proj> I make_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> make_heap(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{});

Effects: Constructs a heap out of the range [first,last).

Returns: last

Complexity: At most 3 * (last - first) applications of the comparison function and projection.