The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
Visual Studio 2012
Stores a starting value, beginning with the first element and filling with successive increments of that value (_Value++) in each of the elements in the interval [_First, _Last).
template<class ForwardIterator, class Type>
void iota(
ForwardIterator _First,
ForwardIterator _Last,
Type _Value
);
The following example demonstrates some uses for the iota function by filling a list of integers and then filling a vector with the list so that the random_shuffle function can be used.
// compile by using: cl /EHsc /nologo /W4 /MTd #include <algorithm> #include <numeric> #include <list> #include <vector> #include <iostream> using namespace std; int main(void) { list <int> intList(10); vector <list<int>::iterator> intVec(intList.size()); // Fill the list iota(intList.begin(), intList.end(), 0); // Fill the vector with the list so we can shuffle it iota(intVec.begin(), intVec.end(), intList.begin()); random_shuffle(intVec.begin(), intVec.end()); // Output results cout << "Contents of the integer list: " << endl; for (auto i: intList) { cout << i << ' '; } cout << endl << endl; cout << "Contents of the integer list, shuffled by using a vector: " << endl; for (auto i: intVec) { cout << *i << ' '; } cout << endl; }