A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://sgistl.github.io/fill_n.html below:

fill_n

fill_n Prototype
template <class OutputIterator, class Size, class T>
OutputIterator fill_n(OutputIterator first, Size n, const T& value);
DescriptionFill_n assigns the value value to every element in the range [first, first+n). That is, for every iterator i in [first, first+n), it performs the assignment *i = value. The return value is first + n. Definition Defined in the standard header algorithm, and in the nonstandard backward-compatibility header algo.h. Requirements on types Preconditions Complexity Linear. Fill_n performs exactly n assignments. Example
vector<double> V;
fill_n(back_inserter(V), 4, 42);
assert(V.size() == 4 && V[0] == 42 && V[1] == 42 && V[2] == 42 && V[3] == 42);
Notes See alsocopy, fill, generate, generate_n, iota STL Main Page

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4