Does it still make sense in C++11 to use vector::push_back()
instead of vector::emplace_back()
, and similarly map::insert()
instead of map::emplace()
?
My understanding is that the new modern C++11 emplace-methods construct objects in place with the given arguments (perfectly forwarded to constructors), so they save copy and move operations, so they should be more efficient than their old C++98/03 counterparts.
Am I missing something about that?
Is it safe to discourage the use of the old-style methods?