http://stxxl.sourceforge.net
<tb@panthema.net>
http://www.boost.org/LICENSE_1_0.txt
#include <iostream>
#include <limits>
#include <stxxl/vector>
#include <stxxl/random>
#include <stxxl/sort>
struct my_less_int : std::less<int>
{
int min_value() const { return std::numeric_limits<int>::min(); }
int max_value() const { return std::numeric_limits<int>::max(); }
};
int main()
{
stxxl::VECTOR_GENERATOR<int>::result vector;
stxxl::random_number32 random;
for (size_t i = 0; i < 100 * 1024 * 1024; ++i) {
vector.push_back(random());
}
stxxl::sort(vector.begin(), vector.end(), my_less_int(), 16 * 1024 * 1024);
std::cout << vector.size() << " items sorted ranging from "
<< vector.front() << " to " << vector.back() << std::endl;
return 0;
}