This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Hi,

On 03/15/2013 09:45 PM, François Dumont wrote:
Hello

I think I have completed support of C++11 allocators in unordered containers.
Thanks. I think Jon can review this patch of yours much better than me.

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 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 ?
I think it's fine like this.

I also noticed that operator=(std::initializer_list<>) could reuse existing nodes rather than reallocating everything. I kept it for a future patch.
This reminds me libstdc++/29988, which probably it's time to revisit.

Also, since we are going to stabilize to a new ABI for 4.9, I think we should seriously try to rework the unordered containers to have a noexcept default constructor (actually std::deque too, not trivial I'm afraid)

Thanks!
Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]