logoalt Hacker News

accelbred • today at 4:25 PM • 1 reply • view on HN

Many of the big C++ projects I've worked with have custom string types since the standard one was defficient for some reason or another.


Replies

jstimpfle • today at 4:31 PM

Exactly, and a simple usable string type is just a struct MyString { char *buf; size_t len; }; away. Actual magic is in how you use it, where you allocate it, how you integrate allocation and formatting and logging and I/O... i.e. all the things that aren't solved by crufty complex std::string either.