A simple heap based on std::push_heap and std::pop_heap. More...
#include <utilidor.h>
Public Member Functions | |
bool | empty () const |
Is the heap empty. Returns true if yes. | |
heap () | |
The default constructor. More... | |
void | pop () |
Remove the top element from the heap. | |
void | push (T *v) |
Add a new element to the heap. | |
void | reserve (size_t n) |
Reserve space. | |
size_t | size () const |
The number of elements in the heap. | |
T * | top () const |
The top element. No error checking! | |
Public Attributes | |
const C | comp_ |
An object of the comparator type. | |
std::vector< T * > | data_ |
A vector to hold pointers to the underlying data. | |
A simple heap based on std::push_heap and std::pop_heap.
|
inline |
The default constructor.
It creates an empty vector with the specified type and a comparator object.