4 ms·
What's wrong with std::string though?
by autoreleasepool 11y ago
What's wrong with std::string though?
- raverbashing 11y agohttps://msdn.microsoft.com/en-us/library/hh438469.aspx https://msdn.microsoft.com/en-us/library/hh438469.aspx
- hellofunk 11y agoCompared to how strings are handled in many other languages or libraries, std::string is pretty limited. It works, though, and I use it. But when you have to do something basic like a trim, you find yourself wondering why it's not included.
- CyberDildonics 11y agohttps://github.com/imageworks/pystring https://github.com/imageworks/pystring
- roel_v 11y agoWhat isn't? Without boost::format and boost::algorithm, std::string is a major pain in the ass to work with. Even including those two, there's still the distinct lack of unicode-awareness (and no, wstring doesn't help, and neither does "let's pretend it's all utf8 underneath".) And then there is the institutional problem that nobody agrees on whether, and if so how, to use std::string in their libraries' API's. But on the bright side, string handling in C++ is not as painful today as it was in 2005, things do get better.
- nmeofthestate 11y agoI'd argue that a mutable by-value string type is not suited to most applications, hence why many other languages have avoided providing that style of string type as their core string type.