[PATCH][_Hashtable] Fix insertion of range of type convertible to value_type PR 56112
François Dumont
frs.dumont@gmail.com
Wed May 11 17:03:52 GMT 2022
Gentle reminder !
On 05/05/22 19:37, François Dumont wrote:
> Hi
>
> Renewing my patch to fix PR 56112 but for the insert methods, I
> totally change it, now works also with move-only key types.
>
> I let you Jonathan find a better name than _ValueTypeEnforcer as usual
> :-)
>
> libstdc++: [_Hashtable] Insert range of types convertible to
> value_type PR 56112
>
> Fix insertion of range of types convertible to value_type. Fix also
> when this value_type
> has a move-only key_type which also allow converted values to be moved.
>
> libstdc++-v3/ChangeLog:
>
> PR libstdc++/56112
> * include/bits/hashtable_policy.h (_ValueTypeEnforcer): New.
> * include/bits/hashtable.h
> (_Hashtable<>::_M_insert_unique_aux): New.
> (_Hashtable<>::_M_insert(_Arg&&, const _NodeGenerator&,
> true_type)): Use latters.
> (_Hashtable<>::_M_insert(_Arg&&, const _NodeGenerator&,
> false_type)): Likewise.
> (_Hashtable(_InputIterator, _InputIterator, size_type, const
> _Hash&, const _Equal&,
> const allocator_type&, true_type)): Use this.insert range.
> (_Hashtable(_InputIterator, _InputIterator, size_type, const
> _Hash&, const _Equal&,
> const allocator_type&, false_type)): Use _M_insert.
> * testsuite/23_containers/unordered_map/cons/56112.cc: Check
> how many times conversion
> is done.
> (test02): New test case.
> * testsuite/23_containers/unordered_set/cons/56112.cc: New test.
>
> Tested under Linux x86_64.
>
> Ok to commit ?
>
> François
>
More information about the Libstdc++
mailing list