chsvlib
chsv helper source code

◆ construct_move_n()

OutputIterator Chusov::Memory::construct_move_n ( InputIterator  input,
std::size_t  size,
OutputIterator  output 
)
noexcept

Move-constructs a given number of elements starting from one referred to by an input iterator in the destination addressed by an output iterator.

Template Parameters
InputIteratorThe type of an input iterator which addresses the start of a sequence of elements to copy.
OutputIteratorThe type of an output iterator specifying the destination of the copy operation. Dereferencing of the iterator must yield an actual memory buffer where the constructed element shall reside.
Parameters
inputThe input iterator associated with the beginning of the input sequence of elements to copy.
sizeThe number of elements in the input sequence to copy.
outputThe output iterator. The expression *output must yield a reference to the actual buffer, in an uninitialized state, where the corresponding element of the output sequence is copy-constructed.
Returns
The output iterator after the move operation, i.e. the iterator associated with the position in the destination after the last moved-in element, or output, if size is zero.
Exceptions
Anyexception that originates from move-construction of the sequence elements.

The operation does not invoke any destructors or assignment operators for elements of the moved sequences, i.e. the function moves elements into uninitialized memory buffers discarding its prior contents. To replace existing elements with move-assignment, use the move_n function.