Name: Anonymous 2016-07-20 3:56
Must support:
* Adding elements
* Regrowing
* Adding elements
* Regrowing
reserve()
, but actually seeing that used correctly --- or at all --- is rare.malloc()
and realloc()
anyway. Large fixed allocations go in static arrays, small static allocations go on the stack, and small dynamic allocations can either be treated as small static ones (if the upper limit is not too high) or a fixed heap allocation. They all have different characteristics and assuming std::vector is the best for all of those use-cases is just plain stupid.