max_load_factor constant complexity
Jonathan Wakely
jwakely@redhat.com
Tue Jun 30 22:18:00 GMT 2015
On 30/06/15 22:25 +0200, François Dumont wrote:
>Hi
>
> During a recent discussion on Reflector about max_load_factor some
>pointed that libstdc++ has not the constant complexity as imposed by the
>Standard in Table 103 because we try to respect the new factor by
>potentially rehashing the container. This patch fix this problem by
>adopting VS Standard Library behavior of retaining the targeted
>max_load_factor and comply to it as soon as possible on insertion.
>
> * include/bits/hashtable.h (_Hashtable<>::__rehash_policy): Remove
> container rehash.
> * testsuite/23_containers/unordered_set/max_load_factor/robustness.cc:
> Adapt.
>
>Tested under linux x86_64.
>
>Ok to commit ?
OK, thanks.
More information about the Libstdc++
mailing list