24 Algorithms library [algorithms]

24.7 Sorting and related operations [alg.sorting]

24.7.7 Heap operations [alg.heap.operations]

24.7.7.3 make_­heap [make.heap]

template<class RandomAccessIterator> constexpr void make_heap(RandomAccessIterator first, RandomAccessIterator last); template<class RandomAccessIterator, class Compare> constexpr void make_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); namespace ranges { template<RandomAccessIterator I, Sentinel<I> S, class Comp = ranges::less<>, class Proj = identity> requires Sortable<I, Comp, Proj> constexpr I make_heap(I first, S last, Comp comp = {}, Proj proj = {}); template<RandomAccessRange R, class Comp = ranges::less<>, class Proj = identity> requires Sortable<iterator_t<R>, Comp, Proj> constexpr safe_iterator_t<R> make_heap(R&& r, Comp comp = {}, Proj proj = {}); }
Let comp be less{} and proj be identity{} for the overloads with no parameters by those names.
Requires: For the overloads in namespace std, the type of *first shall meet the Cpp17MoveConstructible (Table 26) and Cpp17MoveAssignable (Table 28) requirements.
Effects: Constructs a heap with respect to comp and proj out of the range [first, last).
Returns: last for the overloads in namespace ranges.
Complexity: At most comparisons and twice as many projections.