Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Large part of why standard was changed so that GCC's copy-on-write strings became non-standard compliant was because CoW made std::string_view and such extremely hazardous. CoW has its benefits but also huge downsides, and small-string optimisation makes lot more sense with the C++11 move semantics.


For many people SSO would be a waste of time except you need to store the empty string.

There are people who make a lot of very short strings and need them to go fast, but not so many to justify making that a core language feature, if not for the fact that C++ empty string needs a zero byte for C compatibility.

That's why Rust got away without it, their empty string has length zero.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: