#include <iostream>
#include <vector>
#include <algorithm>
using std::cout;
using std::endl;
using std::vector;
double valueGenerator()
{
static double val = 1.0;
val += val;
return val;
}
int main()
{
vector<double> vec(6);
generate(vec.begin(), vec.end(), valueGenerator);
for (double val : vec)
cout << val << " ";
cout << endl;
return 0;
}
/*
run:
2 4 8 16 32 64
*/