August 2012
Intermediate to advanced
976 pages
30h 17m
English
Many algorithms write new values to the elements in the given sequence. These algorithms can be distinguished from one another both by the kinds of iterators they use to denote their input sequence and by whether they write elements in the input range or write to a given destination.
These algorithms require an output iterator that denotes a destination. The _n versions take a second argument that specifies a count and write the given number of elements to the destination.
fill(beg, end, val)fill_n(dest, cnt, val)generate(beg, end, Gen)generate_n(dest, cnt, Gen)
Assigns a new value to each element in the input sequence. fill assigns the value val; ...
Read now
Unlock full access