Should I replace all calls to push_back with emplace_back?
问题 In my C++ application I heavily use STL containers like vector . There are a lot of calls to push_back , and I have been concerned about unnecessary constructions and copy operations. My application is pretty low-level and I am very concerned about CPU and memory usage. Should I replace all calls to push_back with calls to emplace_back ? I am using Visual Studio 2013. 回答1: It is an almost always rule. You cannot rely on side effect of copy constructors so it should means that skipping it