Re:Simple Dynamic Strings library for C, compatible with nul...
by jhallenworld on Tuesday December 03, 2019 @06:29PM
(#21698044)
A main problem with C++ is that it uses .c_str() instead of something nice like .s for this.
In fact, I even find the explicitness more pleasantly and clearly readable: I like being able to know at-a-glance when types are changing, especially in a language as unsafe as C.
Lastly, if you can tolerate just using some of C++‘s features, you can define a no-compromise solution: A type (still represented by a single pointer under-the-hood) that will implicitly convert (with zero runtime cost) into a C string but not vice versa.