You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
std::stringstream ss("a very long string that exceeds the small string optimization buffer length");
constchar *p = ss.view().data();
std::string s = std::move(ss).str();
assert(s.data() == p); // shouldn't be a second allocation
In C++20 and later, moving-out-of ss should move the string, not make a fresh copy.