I\'m a bit confused regarding the difference between push_back and emplace_back.
void emplace_back(Type&& _Val);
void push_
Specific use case for emplace_back: If you need to create a temporary object which will then be pushed into a container, use emplace_back instead of push_back. It will create the object in-place within the container.
Notes:
push_back in the above case will create a temporary object and move it
into the container. However, in-place construction used for emplace_back would be more
performant than constructing and then moving the object (which generally involves some copying).emplace_back instead of push_back in all the cases without much issue. (See exceptions)