debug shrink_to_fit

François Dumont francois.cppdevs@free.fr
Thu Jun 9 20:21:00 GMT 2011


Here is a new proposition:

2011-06-09  François Dumont <francois.cppdevs@free.fr>

         * include/bits/stl_vector.h, stl_deque.h, stl_bvector.h,
         basic_string.h: Have schrink_to_fit return a boolean value to 
indicate
         if it has been shrinked or not.
         * include/ext/vstring.h: Likewise.
         * include/bits/allocator.h (__shrink_to_fit): Use move iterator if
         move constructor do not throw.
         * include/debug/vector, deque, string: Add shrink_to_fit debug
         implementation.
         * testsuite/23_containers/vector/debug/shrink_to_fit.cc: New.
         * testsuite/23_containers/deque/debug/shrink_to_fit.cc: New.
         * testsuite/21_string/debug/shrink_to_fit.cc: New.

François

On 06/08/2011 09:43 PM, François Dumont wrote:
> Ok thanks, if I can change shrink_to_fit signature it could be easier, 
> indeed. I will submit the new patch tomorrow.
>
> François
>
> On 06/08/2011 01:06 PM, Paolo Carlini wrote:
>> ... in fact, when I did this shrink_to_fit little piece of work I was 
>> probably "smoking crack". The below is perfectly fine and your fix 
>> should be much simpler on top of it.
>>
>> Tested x86_64-linux.
>>
>> Thanks,
>> Paolo.
>>
>> ////////////////////
>
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: shrink_to_fit.patch
Type: text/x-patch
Size: 9480 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20110609/bb83d689/attachment.bin>


More information about the Libstdc++ mailing list