std::vector::emplace_back and std::move
问题 Is there any advantage of using std::vector::emplace_back and std::move together? or it is just redundant since std::vector::emplace_back will do an inplace-construction? Cases for clarification: std::vector<std::string> bar; First: bar.emplace_back(std::move(std::string("some_string"))); Second: std::string str("some_string"); bar.emplace_back(std::move(str)); Third: bar.emplace_back(std::move("some_string")); 回答1: In the second version, there is an advantage. Calling emplace_back will call