5 ms·
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. Th
by darkpore 12y 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...
- thrownaway2424 12y agoYou can use a feedback directed optimization pass to choose the initial size.