[PATCH][_Hashtable] Fix some implementation inconsistencies
François Dumont
frs.dumont@gmail.com
Thu Jun 6 17:02:28 GMT 2024
No chance ?
On 22/05/2024 06:50, François Dumont wrote:
> Ping ?
>
> On 13/05/2024 06:33, François Dumont wrote:
>> libstdc++: [_Hashtable] Fix some implementation inconsistencies
>>
>> Get rid of the different usages of the mutable keyword except in
>> _Prime_rehash_policy where it is preserved for abi compatibility
>> reason.
>>
>> Fix comment to explain that we need the computation of bucket
>> index noexcept
>> to be able to rehash the container when needed.
>>
>> For Standard instantiations through std::unordered_xxx containers
>> we already
>> force caching of hash code when hash functor is not noexcep so it
>> is guarantied.
>>
>> The static_assert purpose in _Hashtable on _M_bucket_index is
>> thus limited
>> to usages of _Hashtable with exotic _Hashtable_traits.
>>
>> libstdc++-v3/ChangeLog:
>>
>> * include/bits/hashtable_policy.h
>> (_NodeBuilder<>::_S_build): Remove
>> const qualification on _NodeGenerator instance.
>> (_ReuseOrAllocNode<>::operator()(_Args&&...)): Remove const
>> qualification.
>> (_ReuseOrAllocNode<>::_M_nodes): Remove mutable.
>> (_Insert_base<>::_M_insert_range): Remove _NodeGetter
>> const qualification.
>> (_Hash_code_base<>::_M_bucket_index(const
>> _Hash_node_value<>&, size_t)):
>> Simplify noexcept declaration, we already static_assert
>> that _RangeHash functor
>> is noexcept.
>> * include/bits/hashtable.h: Rework comments. Remove const
>> qualifier on
>> _NodeGenerator& arguments.
>>
>> Tested under Linux x64, ok to commit ?
>>
>> François
>>
More information about the Libstdc++
mailing list