News for hackers. Stuff that matters.
Re:Appending to an std:string character-by-character: how do... by not2b on Friday October 27, 2023 @01:39AM (#38035068)
No, but there was an unreasonable one. Microsoft Foundation Classes, which preceded the STL. Originally, Their CString class extended the capacity in such a way that appending one character at a time had quadratic cost.
Re:Appending to an std:string character-by-character: how do... by rurban on Friday October 27, 2023 @04:14AM (#38035956)
It was just using the naive approach (grow by the exact size), the same idea as Google is now proposing. https://news.ycombinator.com/item?id=38033206