This example code is explained in the STXXL Queue section.
#include <iostream>
int main()
{
a_queue my_queue;
{
random = rand32();
my_queue.push(random);
}
unsigned int last_inserted = my_queue.back();
STXXL_MSG(
"last element inserted: " << last_inserted);
while (!my_queue.empty())
{
if (last_inserted > my_queue.front())
{
STXXL_MSG(
"found smaller element: " << my_queue.front() <<
" than last inserted element");
break;
}
std::cout << my_queue.front() << " " << std::endl;
my_queue.pop();
}
return 0;
}