[patch] No allocation for empty unordered containers

Jonathan Wakely jwakely@redhat.com
Mon Aug 4 11:55:00 GMT 2014


On 04/08/14 12:49 +0100, Jonathan Wakely wrote:
>On 25/07/14 22:53 +0200, François Dumont wrote:
>>Hi
>>
>>   I think I never get feedback regarding this patch proposal. Note
>
>I've been trying to weigh up the pros and cons and am unsure what's
>best, but I think my preference is to have a noexcept default
>constructor. Unless you hear any objections in the next 48 hours
>please go ahead and commit this to trunk, thanks

I hit send too soon, I meant to say that I think this change is also
needed:

>>>   I don't know if you had in mind to noexcept qualify the default 
>>>constructor but it would mean to have a real default constructor 
>>>and another to deal with the hint which wouldn't match the 
>>>Standard so no noexcept qualification at the moment.

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.



More information about the Libstdc++ mailing list