This example code is explained in the STXXL Priority Queue section
#include <limits>
struct Cmp
{
bool operator () (const int& a, const int& b) const
{ return a < b; }
int min_value() const
};
int main()
{
typedef pq_type::block_type block_type;
const unsigned int mem_for_pools = 32 * 1024 * 1024;
pq_type Q(pool);
Q.push(1);
Q.push(4);
Q.push(2);
Q.push(8);
Q.push(5);
Q.push(7);
assert(Q.size() == 6);
assert(Q.top() == 8);
Q.pop();
assert(Q.top() == 7);
Q.pop();
assert(Q.top() == 5);
Q.pop();
assert(Q.top() == 4);
Q.pop();
assert(Q.top() == 2);
Q.pop();
assert(Q.top() == 1);
Q.pop();
assert(Q.empty());
return 0;
}