The "basic" in the C++ standard library does not imply anything. Making the string_view remain valid after moving the string is not a problem in implementation, it only requires not eagerly cleaning up the moved-from string. This makes them similar to vector
and span. Therefore, small_string is unnecessary.
There is a history of STL implementations introducing string optimisations, for example, copy-on-write in GCC (<=4), adoption of small string optimisation
(SSO) - with varying details across GCC, Clang, and MSVC.
Focusing on SSO, using std::string, along with std::string_view and move semantics, introduces a frustrating folly.
The name std::basic_string implies a basic implementation, and many assume it is nothing more than a wrapper around a C-style character pointer with
bounds checking.
Could we discuss introducing an alternative string implementation (std::buffered_string, std::small_string) to the standard that allows optimisations
without specifying the core details? Hopefully, this will add some clarity to the end-user.
Thank you for your time.
Regards,
Ben Crowhurst