Discussion Proposal for a full-fledged C String Dynamic allocation, SSO, views, refcounting, etc.. are spread on various implementations.C++ separates string and string_view. And they're not fully compatible. (Ex. you can't concat cross-type !?).Rust has str, &str, String Box<str>, ... ?In the spirit of "a slice of a string is still a string", why not pack it all into a single type ? And offer security in the process.Here's the scheme : https://github.com/alcover/buffet/raw/main/assets/schema.pngHere's the code : https://github.com/alcover/buffetNB: I'm talking string/byte buffer. Higher string tooling like Utf8 would go a layer above. 12 points alcover 4 years ago 12 comments
C++ separates string and string_view. And they're not fully compatible. (Ex. you can't concat cross-type !?).
Rust has str, &str, String Box<str>, ... ?
In the spirit of "a slice of a string is still a string", why not pack it all into a single type ? And offer security in the process.
Here's the scheme : https://github.com/alcover/buffet/raw/main/assets/schema.png
Here's the code : https://github.com/alcover/buffet
NB: I'm talking string/byte buffer. Higher string tooling like Utf8 would go a layer above.