Date: Mon, 18 Aug 2025 13:17:30 +0200
You are suggesting a new string class, which allows more optimizations.
Could you go into detail, what kind of optimizations you think of (example), and why they are not possible and not implemented in the current std::basic_string and why they are more allowed in the new class.
Perhaps beside allowing something to implementations, there is also a use case for a different string-like class or a different interface.
-----Ursprüngliche Nachricht-----
Von:Ben Crowhurst via Std-Proposals <std-proposals_at_[hidden]>
Gesendet:Mo 18.08.2025 12:33
Betreff:[std-proposals] Forbid optimisations on std::basic_string implementations.
An:std-proposals_at_[hidden];
CC:Ben Crowhurst <ben.crowhurst_at_[hidden]>;
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
--
Std-Proposals mailing list
Std-Proposals_at_[hidden]
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2025-08-18 11:28:10