Empty string: Difference between revisions
Content deleted Content added
Line 463:
str = ""; // replace contents with empty string
str = {}; // swap contents with temp string (empty),then destruct temp
std::swap(str, {}); // swap contents with empty string (empty initializer list)▼
// swap with empty string
std::string tmp{}; // temp empty string
str.swap(tmp); // (builtin swap function)
// create an array of empty strings
|