dimanche 31 décembre 2017

How does std::string::erase remove characters from a string?

Consider the following code for example.

string str = "Alice ate apples"; 
str.erase(0, 2)

Does erase function actually allocate new memory and copy the "ice ate apples" or does erase function do an in-place copy?

Aucun commentaire:

Enregistrer un commentaire