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
-
InputIterator | The type of an input iterator which addresses the input sequence of elements to move. |
OutputIterator | The 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
-
start | The input iterator associated with the beginning of the input sequence of elements to move. |
end | The input iterator associated with the past-the-end position of the input sequence. |
output | The 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
-
Any | exception 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.