http://stxxl.sourceforge.net
<daniel.feist@student.kit.edu>
http://www.boost.org/LICENSE_1_0.txt
#include <stxxl/sorter>
#include <stxxl/stats>
#include <stxxl/timer>
#include <limits>
struct my_comparator
{
bool operator () (const int& a, const int& b) const
{
return a < b;
}
int min_value() const
{
return std::numeric_limits<int>::min();
}
int max_value() const
{
return std::numeric_limits<int>::max();
}
};
int main()
{
typedef stxxl::sorter<int, my_comparator> sorter_type;
sorter_type int_sorter(my_comparator(), 64 * 1024 * 1024);
for (int i = 1000; i > 0; i--)
{
int_sorter.push(i);
}
int_sorter.sort();
while (!int_sorter.empty())
{
std::cout << *int_sorter << " ";
++int_sorter;
}
return 0;
}