Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
make_heap
Prototype

template<class RandomAccessRange>
RandomAccessRange& make_heap(RandomAccessRange& rng);

template<class RandomAccessRange>
const RandomAccessRange& make_heap(const RandomAccessRange& rng);

template<class RandomAccessRange, class Compare>
RandomAccessRange& make_heap(RandomAccessRange& rng, Compare pred);

template<class RandomAccessRange, class Compare>
const RandomAccessRange& make_heap(const RandomAccessRange& rng, Compare pred);

Description

make_heap turns rng into a heap.

The ordering relationship is determined by using operator< in the non-predicate versions, and by evaluating pred in the predicate versions.

Definition

Defined in the header file boost/range/algorithm/heap_algorithm.hpp

Requirements

For the non-predicate versions:

For the predicate versions:

Complexity

Linear. At most 3 * distance(rng) comparisons.


PrevUpHomeNext