chsvlib
chsv helper source code

◆ construct_move()

OutputIterator Chusov::Memory::construct_move ( InputIterator  start,
InputIterator  end,
OutputIterator  output 
)
noexcept

Move-constructs a sequence of elements in a destination specified by an output iterator from an input sequence addressed by a pair of input iterators.

Template Parameters
InputIteratorThe type of an input iterator which addresses the input sequence of elements to move.
OutputIteratorThe type of an output iterator specifying the destination of the move operation. Dereferencing of the iterator must yield an actual memory buffer where the constructed element shall reside.
Parameters
startThe input iterator associated with the beginning of the input sequence of elements to move.
endThe input iterator associated with the past-the-end position of the input sequence.
outputThe output iterator.
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 the input sequence is empty.
Exceptions
Anyexception that originates from move-assignment of the sequence elements.

The function behaves exactly like the standard std::copy except that construct_move performs move-construction in uninitialized memory space rather than move-assignment of the sequence elements. Also, the input and output sequences must not overlap in memory.

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 function.