chsvlib
chsv helper source code

◆ construct_fill_n()

void Chusov::Memory::construct_fill_n ( ForwardIterator  start,
std::size_t  size,
const T &  value 
)
noexcept

Copy-constructs elements of an iterated output sequence of a given size using a copy of a supplied value.

Template Parameters
ForwardIteratorAn output forward iterator used to iterate over a sequence of uninitialized memory buffers, in which the function constructs copies of value.
TA type of the value used to copy-construct all elements of the output sequence.
Parameters
startAn iterator associated with the first buffer to hold a copy-constructed element.
sizeA number of elements to initialize in the output sequence.
valueA sample to parameterize all invocations of copy-constructors to produce elements of the output sequence.
Exceptions
Anyexceptions thrown as a result of invoking copy-construction to initialized the output sequence of elements.

The function does not invoke any destructors or assignment operators discarding prior contents of the output memory. To replace existing elements with copies of value rather than construct new elements in uninitialized space, use the fill_n function.