Let's consider the following functions:
void processString1(const string & str) { /** **/}
void processString2(string && str) { /** **/}
processString1("Hello");
processString2("Hello");
As I assume, processString1 will invoke copy constructor and processString2 a move constructor of string. What is more efficient?
Aucun commentaire:
Enregistrer un commentaire