I would like to fill a vector using std::fill, but instead of one value, the vector should contain numbers in increasing order after.
There is another option - without using iota. For_each + lambda expression can be used:
vector ivec(10); // the vector of size 10
int i = 0; // incrementor
for_each(ivec.begin(), ivec.end(), [&](int& item) { ++i; item += i;});
Two important things why it's working: