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

Jonathan Wakely jwakely.gcc@gmail.com
Sat Apr 6 18:01:00 GMT 2013


Some quick responses to the mail with the original version of the
patch last month ...

On 15 March 2013 20:45, François Dumont wrote:
> Hello
>
>     I think I have completed support of C++11 allocators in unordered
> containers.

Excellent!

>     I preferred to remove the const of the key part to enable copy/move
> assignment in the context of std::unordered_map/multimap. This will give
> more behavioral consistency accross all the std::unordered_* types.

I was thinking that using C++11 allocators and reusing existing
objects could be done as two separate patches, as they're related but
not dependent on each other, but this is OK.

>     I took the opportunity to remove include of <bits/stl_algobase.h> from
> <unordered_set> and <unordered_map> Standard headers. It became useless
> since _Prime_rehash_policy definition that is using std::lower_bound moved
> to src/c++11/hashtable_c0x.cc. This source file doesn't need it neither
> because bits/stl_algobase.h is included by the way through an other path,
> should I add it explicitly ?

No, I think that's OK.

>     I also noticed that operator=(std::initializer_list<>) could reuse
> existing nodes rather than reallocating everything. I kept it for a future
> patch.

That's fine.

A review of the updated patch coming next...



More information about the Libstdc++ mailing list