[RFC] Vector (string?) growth factor of 1.5 (insted of 2)

Paolo Carlini pcarlini@suse.de
Tue Feb 3 18:08:00 GMT 2004


Matt Austern wrote:

>>> A detail comes to my mind, though: perhaps, at construction time,
>>> speed matters more and, in the case of the constructor from input
>>> iterators, we should allow for a bigger factor. Later, memory usage
>>> matters more and a smaller factor seem in order (-> as you say, if
>>> the max speed is really needed reserve is always available, then).
>>
>> Yes. This seems to me to be a really nice suggestion! Make the growth
>> factor inversely proportional to the size of the vector.
>
> I don't think that is a good suggestion.  In fact, I don't think it is 
> standard
> conforming.

Thanks Matt for your message and for its technical details.

I hasten to point out, however, that what *I* suggested is different and 
much
more simple, while conforming (I hope so!): simply expand with two different
factors inside the constructor from input iterators and during the following
use of the container. Not a big deal, after all. Just a small idea.

Paolo.



More information about the Libstdc++ mailing list