vendredi 7 avril 2017

C++ emplace_back parameters

Here is a piece of code in my daily work. I just want to ask you if there is any difference between the two cases, especially in terms of performance.

std::vector< std::pair<std::string, std::string> > aVec;

// case 1
aVec.emplace_back("hello", "bonjour");

// case 2
aVec.emplace_back(std::pair("hello", "bonjour"));

Aucun commentaire:

Enregistrer un commentaire