I was reading the documentation for priority_queue (basically a wrapper over make_heap), and it found out that you can customize it with a compare function.
From the documentation(http://en.cppreference.com/w/cpp/container/priority_queue):
A user-provided Compare can be supplied to change the ordering, e.g. using std::greater would cause the smallest element to appear as the top().
In Wikipedia and other CS texts a heap is defined as such:
In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: If A is a parent node of B then the key (the value) of node A is ordered with respect to the key of node B with the same ordering applying across the heap. A heap can be classified further as either a "max heap" or a "min heap". In a max heap, the keys of parent nodes are always greater than or equal to those of the children and the highest key is in the root node.
But in the std::priority_queue implementation, supplying std::greater would cause a MinHeap to be created (smallest element at the top). I would have expected a max heap since a heap ordering is defined (in all the literature that I've read) if (parent comparator children) is true.
I find this kind of API design confusing.
Was there a reason to define it this way?