http://stxxl.sourceforge.net
<daniel.feist@student.kit.edu>
http://www.boost.org/LICENSE_1_0.txt
#include <stxxl/vector>
#include <iostream>
int main()
{
typedef stxxl::VECTOR_GENERATOR<unsigned int, 4, 8, 1*1024*1024, stxxl::RC, stxxl::lru>::result vector_type;
vector_type my_vector;
unsigned int counter = 0;
unsigned int tmp;
stxxl::random_number<> rand;
stxxl::uint64 number_of_elements = 32 * 1024 * 1024;
for (stxxl::uint64 i = 0; i < number_of_elements; ++i)
{
tmp = rand(123456789);
my_vector.push_back(tmp);
}
vector_type::const_iterator iter = my_vector.begin();
for (stxxl::uint64 j = 0; j < my_vector.size(); j++)
{
if (*iter % 2 == 0)
{
++counter;
}
iter++;
}
STXXL_MSG("found " << counter << " even numbers in V");
return 0;
}