http://stxxl.sourceforge.net
<daniel.feist@student.kit.edu>
http://www.boost.org/LICENSE_1_0.txt
#include <stxxl/queue>
#include <iostream>
int main()
{
typedef stxxl::queue<unsigned int> a_queue;
a_queue my_queue;
unsigned int random;
stxxl::random_number32 rand32;
stxxl::uint64 number_of_elements = 64 * 1024 * 1024;
for (stxxl::uint64 i = 0; i < number_of_elements; i++)
{
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;
}