[PATCH][Hashtable 5/6] Remove H1/H2 template parameters

François Dumont frs.dumont@gmail.com
Mon Aug 17 17:13:33 GMT 2020


     Here is the new proposal.

     As we can't remove template parameters I simply restore those that 
I tried to pass differently _H2 and _ExtractKey, so eventually I only 
remove usage of _Hash which I renamed in _Unused. Maybe I can keep the 
doc about it in hashtable.h and just add a remark saying that it is now 

     For _RangeHash, formerly _H2, and _ExtractKey I just stop 
maintaining any storage. When we need those I always use a value 
initialized instance. I kind of prefer the value initialization syntax 
because you can't confuse it with a function call but let me know if it 
is wrong and I should use _ExtractKey() or _RangeHash(). I also add some 
static assertions about those types regarding their noexcept qualifications.

     I also included in this patch the few changes left from [Hashtable 
0/6] which are mostly _M_insert_unique_node and _M_insert_multi_node 
signature cleanup as the key part can be extracted from the inserted node.

     Tested under Linux x86_64, ok to commit ?


On 06/08/20 11:27 am, Jonathan Wakely wrote:
> On 06/08/20 08:35 +0200, François Dumont wrote:
>> On 17/07/20 1:35 pm, Jonathan Wakely wrote:
>>> I really like the general idea of getting rid of some of the
>>> complexity and not supporting infinite customization. But we can do
>>> that without changing mangled names of the _Hashtable specialiations.
>> I didn't thought we need to keep abi compatibility for extensions.
> These aren't extensions though, they're part of std::unordered_map
> etc.
> Just because something like _Vector_base is an internal type rather
> than something defined in the standard doesn't mean we can just change
> its ABI, because that would change the ABI of std::vector. It the same
> here.
> Changing _Hashtable affects all users of std::unordered_map etc.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hashtable.patch
Type: text/x-patch
Size: 94027 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200817/63d00a0e/attachment-0001.bin>

More information about the Gcc-patches mailing list