vendredi 1 avril 2016

Concatenation precedence in case of std::string and const char

Is it ok to write the following code?

std::string first = "str";
"1" + first + "2" + std::to_string(1).c_str();

Will first be concatenated with "2" before "2 + std::to_string" concatenation, so there will be no "pointers concatenation" error?

Aucun commentaire:

Enregistrer un commentaire