[Effective-cpp] Vector Capacity and Size

Carol/Matthew Schroeder bigoldog at earthlink.net
Mon Dec 1 05:22:46 EST 2003


----- Original Message ----- 
From: "Adrian Fagg" <AdrianF at evaluategroup.com>
To: <effective-cpp at accu.org>
Sent: Monday, December 01, 2003 1:17 AM
Subject: RE: [Effective-cpp] Vector Capacity and Size

Thanks for the reply.

> Secondly, don't worry about what the implementation actually does - if it
> chooses to make a couple of allocations in the above constructor and end
up
> with a capacity of 23, just shrug your shoulders...

this issue really came up in a conversation elsewhere.  The point made to
me was that leaving the growth strategy completely up to the implementation
is a flaw in the design of the STL.  In situations where memory is critical
and
efficiency is secondary a vector becomes unusable or at best implementation
specific.




More information about the Effective-cpp mailing list