This example code is explained in the STXXL Sorter section.
#include <limits>
struct my_comparator
{
bool operator () (const int& a, const int& b) const
{
return a < b;
}
int min_value() const
{
}
int max_value() const
{
}
};
int main()
{
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;
}