TLDR Web Dev · OPINIONS & ADVICE
DON'T BLINDLY PREFER `EMPLACE_BACK` TO `PUSH_BACK`
Summary from the TLDR Web Dev newsletter
It is a common misconception that `emplace_back` in C++ automatically enables move semantics. `emplace_back` is not magic and does not implicitly move objects. Using `std::move` is necessary to explicitly request a move operation. While both `push_back` and `emplace_back` can achieve the same result with `std::move`, `push_back` should be used by default for better compile-time performance, as `emplace_back` involves more complex template instantiation.