[patch] No allocation for empty unordered containers

Jonathan Wakely jwakely@redhat.com
Tue Aug 5 20:10:00 GMT 2014


On 05/08/14 22:01 +0200, François Dumont wrote:
>On 04/08/2014 13:55, Jonathan Wakely wrote:
>>
>>If we don't make it noexcept then I see no point in avoiding
>>allocation.
>>
>>(And if the functors and allocator can throw then the noexcept might
>>have to be condition.)
>>
>>So please make sure we get that change as well during stage 1.
>>
>>
>
>Hi
>
>    I know why move constructor must be noexcept but why default must 
>be too ?

It doesn't have to be noexcept, but IMHO there is no point changing
the containers to avoid allocation unless that allows us to mark it
noexcept.  If it can throw anyway, we might as well allocate the
initial buckets.



More information about the Libstdc++ mailing list