iota
Prototypetemplate <class ForwardIterator, class T>
void iota(ForwardIterator first, ForwardIterator last, T value);
Description
DefinitionDefined in the standard header numeric, and in the nonstandard backward-compatibility header algo.h. This function is an SGI extension; it is not part of the C++ standard. Requirements on types
Preconditions
ComplexityLinear. Exactly Exampleint main()
{
vector<int> V(10);
iota(V.begin(), V.end(), 7);
copy(V.begin(), V.end(), ostream_iterator<int>(cout, " "));
cout << endl;
}
Notes[1] The name See also |