Why std::make_move_iterator works on vector<string> but not on vector<int>
问题 I was expecting that std::make_move_iterator will always move contents, but it seems not. It looks like it is moving elements in vector<string> but not in vector<int> . See the below code snippet: #include <iostream> #include <iterator> #include <string> #include <vector> void moveIntVector() { std::cout << __func__ << std::endl; std::vector<int> v1; for (unsigned i = 0; i < 10; ++i) { v1.push_back(i); } std::vector<int> v2( std::make_move_iterator(v1.begin() + 5), std::make_move_iterator(v1