Hacker News new | ask | show | jobs
by darkpore 4310 days ago
You can get around a lot of these issues by reserving the size needed up front, or using a custom allocator with std::vector. Not as easy, but still doable.

The reallocation issue isn't fixable this way however...

1 comments

You can use a feedback directed optimization pass to choose the initial size.