You say that, and yet every C++ project I've ever touched in my life has had its own string class with various levels of horror attached. My favorite was the one that stored everything internally as 32-bit characters to be Unicode safe, and was never used in a codebase that had to deal with Unicode.
windows (for example) has had a comprehensive b-string library (type is called BSTR) for about 20 years - due to it's age and provenance it has the downside of thinking a character is a 16-bit value...
(The article is mildly interesting by itself)
Ironically, in almost all of my uses of C++, I did end up writing or using a custom string library there too. (I was doing mostly console games or language interpreters.)
// These provide test if assigned/not assigned
inline operator void*() const
{
return (void *)s;
}
inline bool operator!() const
{
if(s) return 0;
else return 1;
}I have the same gripe with the way the STL is designed. Too tedious to test for empty first before reading an item.
You also have x vector libraries for helping with bound checking in secure sensitive code and macro based generic data structures.
No thanks.