2
이미 구성된 객체에 대한 std :: move 대 emplace_back ()을 사용한 C ++ 11 push_back ()의 효율성
C ++ 11 emplace_back()에서는 일반적으로 push_back()내부 생성을 허용하므로 효율성 측면에서 선호 되지만 push_back(std::move())이미 생성 된 객체와 함께 사용하는 경우에도 마찬가지 입니까? 예를 들어, emplace_back()다음과 같은 경우에 여전히 선호됩니까? std::string mystring("hello world"); std::vector<std::string> myvector; myvector.emplace_back(mystring); myvector.push_back(std::move(mystring)); // (of course assuming we don't care about using the value of mystring after) 또한 …