Lambda the Ultimate

inactiveTopic STL container's allocated space
started 8/1/2001; 6:20:27 PM - last post 8/1/2001; 6:20:27 PM
heherson - STL container's allocated space  blueArrow
8/1/2001; 6:20:27 PM (reads: 218, responses: 0)
I recently discovered that STL containers ( well at least in my BCB5 ) reserves space for 256 elements when inserting the first element. This is ok for small objects like int or float, but terrible when you're dealing with something like 50 byte sized stuff. Or nested containers like set<multiset >.

I can see the logic in reserving space for vectors and deques, but why in lists, maps, and sets which are linked not array? Is there anyway to deal with this problem, short of modifying the STL implementation itself?

BTW, I don't think the C++ Standard specified how much space to reserve. Do you know any implementation that use smaller allocation increments?