Suppose I have a function like this
void fooMethod() {
std::string foo;
foo.resize(40);
bar(foo)
}
void bar(std::string& bar)
{
bar.clear();
bar += xxxx;
}
My question is will clear still maintain the original size of the string ? My assumption is yes because std::string in C++ are mutable please let me know if I am correct ?
Aucun commentaire:
Enregistrer un commentaire