Containers like std::basic_string
and std::vector
perform automatic re-allocations when internal capacity runs out. The standard specifies that, after a re-allocation, .capacity() >= .size()
.
What are some of the actual multipliers used by mainstream toolchains when performing re-allocations?
Update
So far, I have:
See Question&Answers more detail:osDinkumware: 1.5 (ships with MSVS and possibly ICC)
GNU libstdc++: 2 (ships with GCC and possibly ICC)
RW/Apache stdcxx: 1.618 (aka φ)
STLport: 2