[PATCH 3/5][_Hashtable] Avoid redundant usage of rehash policy
Jonathan Wakely
jwakely@redhat.com
Thu Dec 21 22:17:05 GMT 2023
On Thu, 23 Nov 2023 at 21:59, François Dumont <frs.dumont@gmail.com> wrote:
>
> libstdc++: [_Hashtable] Avoid redundant usage of rehash policy
>
> Bypass call to __detail::__distance_fwd and the check if rehash is
> needed when
> assigning an initializer_list to an unordered_multimap or
> unordered_multiset.
I find this patch and the description a bit confusing. It would help
if the new _Hashtable::_M_insert_range function had a comment (or a
different name!) explaining how it's different from the existing
_Insert_base::_M_insert_range functions.
>
> libstdc++-v3/ChangeLog:
>
> * include/bits/hashtable.h
> (_Hashtable<>::_M_insert_range(_InputIte, _InputIte,
> _NodeGen&)): New.
> (_Hashtable<>::operator=(initializer_list<value_type>)): Use latter.
> (_Hashtable<>::_Hashtable(_InputIte, _InputIte, size_type,
> const _Hash&, const _Equal&,
> const allocator_type&, false_type)): Use latter.
> * include/bits/hashtable_policy.h
> (_Insert_base<>::_M_insert_range(_InputIte, _InputIte,
> true_type)): Use latter.
> (_Insert_base<>::_M_insert_range(_InputIte, _InputIte,
> false_type)): Likewise.
>
> Tested under Linux x64
>
> Ok to commit ?
>
> François
More information about the Libstdc++
mailing list