[v3] C++11 allocator reqs for vector in debug & profile mode

François Dumont frs.dumont@gmail.com
Mon Nov 14 20:16:00 GMT 2011


     I wonder if playing with allocator propagation in such a context is 
right. The Standard define shrink_to_fit as a member method and not as a 
global function. People implementing an allocator might not expect 
allocators to be copy or anything else when calling 
vector::shrink_to_fit which can normally be implemented without it.

François

On 11/09/2011 10:14 PM, Jonathan Wakely wrote:
> Like so:
>
>          * include/bits/allocator.h (__shrink_to_fit_aux::_S_do_it): Create
>          the new object with the same allocator.
>          * testsuite/23_containers/vector/capacity/shrink_to_fit2.cc: New.
>
> Tested x86_64-linux, committed to trunk.
>
> Thanks for reminding me about it.



More information about the Libstdc++ mailing list