Maybe somebody knows any newsgroup or internet link, where I can find the
Besides what other gentlemen posted, look into allocators and how they are
used with std::vector, with explicit calls to constructors and destructors
when ::reserve(), etc. optimizations are possible, you have to study
particular standard library implementation what is actually being done.
I'm thinking along the lines of (using the above ::reserve() as example), if
we have a vector with current size = 1000, and we want to reserve 2000..
when we allocate new internal memory block, we don't have to call default
constructor for _every_ object, only those 1000 last ones, the 1000 first
ones can use copy constructor, eg. constructor is explicitly called for each
object which are allocated by the allocator (assuming allocation of 'raw'
memory block).
Further optimizations are also possible using traits for the storage type..
etc.. it's up to the implementations what they do, aslong as the results are
same as defined in the standard. I could be wrong, correct me if was talking
completely out of my ass.
Speaking of the standard, I noticed that the ISO / IEC 14448 (?) 2003 is
available at ansi.org as download, anyone knows if there will be a dead-tree
version available in the near future? I'd like to hold on to that, since I
like to read the standard when I am in the toilet.