I want to add a vector to the end of another vector. To my knowledge, the std::move() function is the "selection function" for this task. Why is std::move() from Microsoft Visual C ++ Express crashing while the manually processed loop works as expected?
I am using Microsoft Visual C ++ 2015 update 3. Unfortunately, I cannot verify this with other compilers.
To my knowledge, the following two parts of the code should work the same. They must move the added_channels elements to the end of the channels .
This is the first option that crashes:
std::move(added_channels.begin(), added_channels.end(), channels.end());
This is the second version that works:
for(auto & ref : added_channels) { channels.push_back(std::move(ref)); }
source share