Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
reserve of vector
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="James Kanze, post: 3653552"] Modulo some fixed values to start with. Most vector implementations start with a capacity of 0, and adding 0 isn't going to make it grow very fast:-). That is, in fact, how Andy Koenig (I think it was he) came up with the golden ratio. It depends. The one case it might matter is if you have a very large vector that you're initializing in a tight loop, from a file. I'm not sure that such cases are that rare. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
reserve of vector
Top