[C++] Vector push_back vs emplace_back, quick conclusion, short video

This is mostly a resource redirection.
I recently encountered a code that used: emplace_back instead of more general push_back.

I tried to google the difference and many results came up with a much confusing explanations.

Then I stumbled on this video.

This is by Jason Turner.
He explains how and why emplace_back is faster than push_back and why we should try to use emplace_back much often (like most of the time).

Comments (2)