I’ve been looking at the C++ documentation for a function which would move a range of elements from one container to another, using move semantics. However, I have not found such a function. What am I missing?
How would I do the following without copying and using explicit loops?
// Move 10 elements from beginning of source to end of dest
dest.end() <- move(source.begin(), source.begin() + 10)
I think you’re looking for
std::movein<algorithm>:It’s just like
std::copy, except it move-assigns instead of copy-assigns.