Wondering what the rationale is for using emplace
instead of push_back
in the well-formed problem. Really, wondering why it’s used at all over push_back
.
Any info’s greatly appreciated.
Wondering what the rationale is for using emplace
instead of push_back
in the well-formed problem. Really, wondering why it’s used at all over push_back
.
Any info’s greatly appreciated.
Hey Piper,
You could take a look of this article for more information http://stackoverflow.com/questions/26198350/understanding-stack-functions-push-vs-emplace.
Please let me know if you have any other questions.
@tsunghsienlee The link talks about rvalue references and variadic templates – but I still don’t understand. Can you provide a different perspective?
Hey Piper,
http://stackoverflow.com/questions/4303513/push-back-vs-emplace-back might be a good explanation also. Basically I will say they are the same but with some slight performance and usage difference.