std::iota (3) - Linux Manuals
Defined in header <numeric>
template< class ForwardIt, class T > (since C++11)
void iota( ForwardIt first, ForwardIt last, T value );
Fills the range [first, last) with sequentially increasing values, starting with value and repetitively evaluating ++value.
first, last - the range of elements to fill with sequentially increasing values starting with value
value - initial value to store, the expression ++value must be well-formed
Exactly last - first increments and assignments.
The function is named after the integer function ⍳ from the programming language APL. It was one of the STL_components that were not included in C++98, but eventually made it into the standard library in C++11.
The following example applies std::shuffle to a vector of std::list iterators since std::shuffle cannot be applied to a std::list directly. std::iota is used to populate both containers.
// Run this code
fill (function template)
generate (function template)