diff options
author | François Dumont <fdumont@gcc.gnu.org> | 2011-09-17 09:12:24 +0000 |
---|---|---|
committer | François Dumont <fdumont@gcc.gnu.org> | 2011-09-17 09:12:24 +0000 |
commit | f723648945799d7b5408f377ecd925138f25a109 (patch) | |
tree | 61b2d732f425b25d21ff17fc77c5100c1255f1cf /libstdc++-v3/include | |
parent | c8bde0019c8ca6f1b97142c845f8d9da7dbf32c9 (diff) |
2011-09-17 François Dumont <fdumont@gcc.gnu.org>
* include/bits/hashtable.h (_Hashtable<>::__rehash_policy(const
_RehashPolicy&)): Commit the modification of the policy only if no
exception occured.
* testsuite/23_containers/unordered_set/max_load_factor/robustness.cc:
New.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@178927 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/bits/hashtable.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h index b097ee78cb5..5c740668b69 100644 --- a/libstdc++-v3/include/bits/hashtable.h +++ b/libstdc++-v3/include/bits/hashtable.h @@ -741,10 +741,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>:: __rehash_policy(const _RehashPolicy& __pol) { - _M_rehash_policy = __pol; size_type __n_bkt = __pol._M_bkt_for_elements(_M_element_count); if (__n_bkt > _M_bucket_count) - _M_rehash(__n_bkt, __pol._M_next_resize); + _M_rehash(__n_bkt, _M_rehash_policy._M_next_resize); + _M_rehash_policy = __pol; } template<typename _Key, typename _Value, |