This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: RE :Re: RE :Re: hashtable local iterator
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: FranÃois Dumont <frs dot dumont at gmail dot com>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Date: Tue, 27 Dec 2011 12:10:15 +0100
- Subject: Re: RE :Re: RE :Re: hashtable local iterator
- References: <178044935.53839.1324627267265.JavaMail.seven@ap8.p7.uk.7sys.net> <4EF5EBD5.1050600@gmail.com>
Hi,
2011-12-24 FranÃois Dumont <fdumont@gcc.gnu.org>
PR libstdc++/51608
* include/bits/hashtable_policy.h (_Equal_helper<>): New,
change the
way the _Equal functor is used depending on whether hash code is
cached or not.
(_Ebo_helper<>): New helper type to introduce EBO when possible.
(_Hash_code_base): Use _Ebo_helper to limit memory footprint. Move
_Equal functor management...
(_Hashtable_base): ...here, new, use _Equal_helper.
(_Local_iterator_base<>, _Locale_iterator<>,
_Locale_const_iterator<>):
New, use _Hash_code_base, implementation of...
* include/bits/hashtable.h (_Hashtable<>::local_iterator,
_Hashtable<>::const_local_iterator): ...those. Add static
assertions
checking that some functors are empty depending on whether
hash code
is cache or not.
(_Hashtable<>::_M_bucket_index): New overloads using current
bucket
count, use through out the _Hastable<> implementation.
* include/bits/unordered_set.h (__unordered_set<>,
__unordered_multiset<>): Cache hash code if hash functor is
not empty.
* include/bits/unordered_map.h (__unordered_map<>,
__unordered_multimap<>): Likewise.
* include/debug/unordered_map
(unordered_map<>::_S_to_local, unordered_multimap<>::_S_to_local):
Adapt to match new local iterator implementation.
* include/debug/unordered_set (unordered_set<>::_S_to_local,
unordered_multiset<>::_S_to_local): Likewise.
* include/profile/unordered_map
(unordered_map<>::_M_profile_destruct,
unordered_multimap<>::_M_profile_destruct): Enhance thanks to
usage of
local iterators.
* include/profile/unordered_set
(unordered_set<>::_M_profile_destruct,
unordered_multiset<>::_M_profile_destruct): Likewise.
*
testsuite_files/23_containers/unordered_set/instantiation_neg.cc:
Fix error line.
* testsuite_files/23_containers/unordered_set/final_hash.cc: New.
*
testsuite_files/23_containers/unordered_multiset/final_hash.cc: New.
* testsuite_files/23_containers/unordered_map/final_hash.cc: New.
*
testsuite_files/23_containers/unordered_multimap/final_hash.cc: New.
Merry Christmas to you guys.
Merry Christmas and, well, Happy New Year too (for this one I'm not
late, at least ;) !
Patch looks great to me, as a very minor stylistic nit, for static
member functions I think it would make sense to have the static keyword
on the same line of the return type.
Let's wait just one more day or so in order to make sure other people
get a chance to have a look (somebody may be in vacations) and let's
resolve the issue.
Thanks again!
Paolo.