Hacker News new | past | comments | ask | show | jobs | submit
You can also just copy your strings into the same buffer in C++ if you want to.

The obvious downside is that resizing any string but the last requires moving everything down the stack.

With objects that never need resizing, you can of course have much simpler memory layouts.