3 ms·
I don't even know where to start with C++ stdlib string problems, but being mutable and doing a unique heap allocation (above a certain length - a behaviour whi
by flohofwoe 4y ago
I don't even know where to start with C++ stdlib string problems, but being mutable and doing a unique heap allocation (above a certain length - a behaviour which however isn't even standardized) are definitely at the top of the list.
std::string_view would have been a good thing if it hadn't added another memory corruption foot gun.
A universal string type is one of those things where you can either have convenience or performance, but never both.
- pjmlp 4y agoThey are still better than str...() and mem...() all over the place, and all relevant C++ compilers have options to turn bounds checking on.