Add std::unordered_* C++11 allocator support

François Dumont frs.dumont@gmail.com
Mon Apr 22 20:27:00 GMT 2013


On 04/21/2013 10:36 PM, Jonathan Wakely wrote:
> On 21 April 2013 21:08, François Dumont wrote:
>> Hi
>>
>>      Here is another proposal with:
>> - No attempt to remove const key
>> - No attempt to use assignment operator
>> - noexcept move constructor; I slightly modify a static assertion so that it
>> checks that _M_bucket_index is noexcept qualified which depends on the
>> noexcept qualification of the functors involved in bucket computation
>>
>> 2013-04-21  François Dumont  <fdumont@gcc.gnu.org>
>>
>>
>>      * include/bits/hashtable_policy.h: Add C++11 allocator support.
>>      * include/bits/hashtable.h: Likewise.
>>      * include/bits/unordered_set.h: Likewise.
>>      * include/bits/unordered_map.h: Likewise.
>>      * include/debug/unordered_set: Likewise.
>>      * include/debug/unordered_map: Likewise.
>>      * include/std/unordered_set: Remove bits/algobase.h
>>      include. Replace bits/alloc_traits.h by ext/alloc_traits.h.
>>      * include/std/unordered_map: Likewise.
>>      * testsuite/util/testsuite_counter_type.h: Add count of destructors.
>>      * testsuite/23_containers/unordered_set/
>>      not_default_constructible_hash_neg.cc: Adjust dg-error line number.
>>
>>      * testsuite/23_containers/unordered_set/instantiation_neg.cc: Likewise.
>>      * testsuite/23_containers/unordered_set/allocator/copy.cc: New.
>>      * testsuite/23_containers/unordered_set/allocator/copy_assign.cc: New.
>>      * testsuite/23_containers/unordered_set/allocator/minimal.cc: New.
>>      * testsuite/23_containers/unordered_set/allocator/move_assign.cc: New.
>>      * testsuite/23_containers/unordered_set/allocator/noexcept.cc: New.
>>      * testsuite/23_containers/unordered_set/allocator/swap.cc: New.
>>      * testsuite/23_containers/unordered_multiset/allocator/copy.cc: New.
>>      * testsuite/23_containers/unordered_multiset/allocator/copy_assign.cc:
>>      New.
>>      * testsuite/23_containers/unordered_multiset/allocator/minimal.cc: New.
>>      * testsuite/23_containers/unordered_multiset/allocator/move_assign.cc:
>>      New.
>>      * testsuite/23_containers/unordered_multiset/allocator/noexcept.cc: New.
>>      * testsuite/23_containers/unordered_multiset/allocator/swap.cc: New.
>>      * testsuite/23_containers/unordered_map/allocator/copy.cc: New.
>>      * testsuite/23_containers/unordered_map/allocator/copy_assign.cc: New.
>>      * testsuite/23_containers/unordered_map/allocator/minimal.cc: New.
>>      * testsuite/23_containers/unordered_map/allocator/move_assign.cc: New.
>>      * testsuite/23_containers/unordered_map/allocator/noexcept.cc:
>>      New.
>>      * testsuite/23_containers/unordered_map/allocator/swap.cc: New.
>>      * testsuite/23_containers/unordered_multimap/allocator/copy.cc: New.
>>      * testsuite/23_containers/unordered_multimap/allocator/copy_assign.cc:
>>      New.
>>      * testsuite/23_containers/unordered_multimap/allocator/minimal.cc: New.
>>      * testsuite/23_containers/unordered_multimap/allocator/move_assign.cc:
>>      New.
>>      * testsuite/23_containers/unordered_multimap/allocator/noexcept.cc: New.
>>      * testsuite/23_containers/unordered_multimap/allocator/swap.cc: New.
>>
>> Tested under Linux x86_64.
>>
>> Ok to commit ?
> Yes, this is OK for trunk.  Thanks very much!
>
Patch applied.

Note that I haven't updated the C++11 status table. AFAIK you might do 
so before 4.9 release to report C++11 allocator support in std::set/map

François



More information about the Libstdc++ mailing list