On 23/03/11 10:07, Tomalak Geret'kal wrote:
> It's not necessarily strictly doubled.
>
> I don't see why you'd ever reserve *more* than the number of records
> possible from your query. What a pointless waste of space. If anything,
> you'd reserve *exactly* the number of records possible.
You should learn C++ and common techniques before to comment what
experienced developers do or say. For example, std::vector,std::string,
reserve double space each time they exceed in capacity. That's a common
optimisation in “contiguous” containers like std::string and std::vector
(the goal is to lower the number of allocation then copy of handled
objects).
That's explained in Effective C++ from Meyers (Addison Wesley editions).
--
Mickaël Wolff aka Lupus Michaelis
Racine <http://lupusmic.org>
Blog <http://blog.lupusmic.org>