On 23 March 2011 14:13, Tomalak Geret'kal wrote:
> On 23/03/2011 14:11, Warren Young wrote:
> [snip]
>>
>> If you are wrong and your vector implementation's growth
>> strategy is the common 2x one, you have only one
>> reallocation and copy unless you are wrong by a factor of 2
>> * (1 + fudge_factor). If the fudge factor is 10%, that means
>> you have to underestimate the number of returned records by
>> more than 220% to get two or more reallocations and copies.
>>
>
> This notion of "common" is still up for debate.
>
> MSVS uses 1.5x; GCC uses 2x. I'd say that's about half and half, until
> people seriously start using comeau, clang or ICC in production.
It's a property or the standard library, not compiler. Comeau and ICC
don't have their own standard library, they generally use the native
one from MSVC (i.e. Dinkumware) or GCC.
Dinkumware: 1.5
GCC: 2
RW/Apache stdcxx: 1.618
STLport: 2
I don't know what Clang's stdc++ use, but there's definitely variation
between implementations.