|
|
|
|
|
by tialaramex
31 days ago
|
|
In C++ programmers are often taught not to use their reservation API for this purpose because it's designed in such a way that if you don't have perfect foresight you can destroy amortization and thus get much worse performance. For example Bjarne Stroustrup suggests you should use reservation for "avoiding invalidation of iterators" instead. |
|