Why std::string is not smart at all. Why it doesn't have string manipulation features like Format/sprintf, convert to upper, convert to lower, take input from integer/real, to convert to integer/real, and other important functions any string class should have (Reference: CString, wxString, System.String, BASIC strings...).
I am aware that there are new functions like std::to_string, but.. why string itself is so dumb. Why it is just vector<char>? Why still in stone age? Why standards don't make it smart!?
Case comparisons and conversions, in full generality, are hard and require too much information; it's as simple as that.
In American and British English it's simple indeed.
But what about German? E.g. the lower case ß (which in lower case is one character, but in upper case would be two characters: SS).
What about wide character sets which std::string can support? What about accented characters from other European languages like ë?
There's nothing idiotic about this class at all. It has a well defined specification and the standards committee will not emit functionality that could break the language.
As for formatting, this is largely deferred to the streaming libraries, e.g. std::stringstream. There's no reason to incorporate directly into std::string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With