List:MySQL++« Previous MessageNext Message »
From:Tomalak Geret'kal Date:March 23 2011 10:52am
Subject:Re: StoreQueryResults destructor runs without end...
View as plain text  
On 23/03/2011 10:40, Mickael Wolff wrote:
> 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).
>

I am a C++ professional, and have been for many years. Your 
rampant condescension is completely uncalled-for.

*You* should learn C++ before coming back with a response 
like that.

The standard specifies only that, after a re-allocation, 
.capacity() >= .size(). It says nothing about specifically 
doubling capacity.

In ANSI ISO/IEC 14882:2003, see 21.3.3/11 for 
std::basic_string, 23.2.4.2/2 for std::vector, and you can 
look up the rest on your own time.

Tom
Thread
StoreQueryResults destructor runs without end...Paul Dalach22 Mar
Re: StoreQueryResults destructor runs without end...Dino Korah22 Mar
  • Re: StoreQueryResults destructor runs without end...Paul Dalach23 Mar
    • Re: StoreQueryResults destructor runs without end...Warren Young23 Mar
      • Re: StoreQueryResults destructor runs without end...Warren Young23 Mar
        • Re: StoreQueryResults destructor runs without end...Tomalak Geret'kal23 Mar
          • Re: StoreQueryResults destructor runs without end...Mickael Wolff23 Mar
            • Re: StoreQueryResults destructor runs without end...Tomalak Geret'kal23 Mar
              • Re: StoreQueryResults destructor runs without end...Mickael Wolff23 Mar
                • Re: StoreQueryResults destructor runs without end...Tomalak Geret'kal23 Mar
          • Re: StoreQueryResults destructor runs without end...Warren Young23 Mar
            • Re: StoreQueryResults destructor runs without end...Tomalak Geret'kal23 Mar
              • List etiquette - please use good email subjects :)Joel Fielder23 Mar
                • Re: List etiquette - please use good email subjects :)Tomalak Geret'kal23 Mar
                  • Re: List etiquette - please use good email subjects :)Paul Dalach23 Mar
                    • Re: List etiquette - please use good email subjects :)Dino Korah23 Mar
                      • Re: StoreQueryResults destructor runs without end...Paul Dalach23 Mar
                      • Re: StoreQueryResults destructor runs without end...F.N. Bruggeman23 Mar
                    • Re: List etiquette - please use good email subjects :)Joel Fielder23 Mar
              • Re: growth behavior of std::vectorWarren Young23 Mar
                • Re: growth behavior of std::vectorTomalak Geret'kal23 Mar
                  • Re: growth behavior of std::vectorJonathan Wakely23 Mar
                    • Re: (OT) growth behavior of std::vectorTomalak Geret'kal23 Mar
                      • Re: (OT) growth behavior of std::vectorJonathan Wakely23 Mar
                • Re: (OT) growth behavior of std::vectorTomalak Geret'kal23 Mar
            • Re: StoreQueryResults destructor runs without end...Tomalak Geret'kal23 Mar
              • re: (OT) growth behaviour of std::vector [was Re: StoreQueryResultsdestructor runs without end...]Tomalak Geret'kal23 Mar
        • Re: StoreQueryResults destructor runs without end...Warren Young23 Mar
Re: StoreQueryResults destructor runs without end...Dino Korah23 Mar