From 03baef8b2865bf897061fa11db40c6398447cb52 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Thu, 27 Apr 2017 18:22:44 +0100 Subject: [PATCH] Remove Types::is_unique --- .../boost/unordered/detail/implementation.hpp | 34 ++++++++++--------- include/boost/unordered/detail/map.hpp | 8 ----- include/boost/unordered/detail/set.hpp | 8 ----- include/boost/unordered/unordered_map.hpp | 16 ++++----- include/boost/unordered/unordered_set.hpp | 16 ++++----- 5 files changed, 34 insertions(+), 48 deletions(-) diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index 0f5f6807..ae4ba6ca 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -3116,16 +3116,17 @@ struct table : boost::unordered::detail::functions:: - propagate_on_container_copy_assignment::value>()); + assign(x, is_unique, + boost::unordered::detail::integral_constant:: + propagate_on_container_copy_assignment::value>()); } } - void assign(table const& x, false_type) + void assign(table const& x, bool is_unique, false_type) { // Strong exception safety. set_hash_functions new_func_this(*this, x); @@ -3140,18 +3141,18 @@ struct table : boost::unordered::detail::functions:: - propagate_on_container_move_assignment::value>()); + x, is_unique, + boost::unordered::detail::integral_constant:: + propagate_on_container_move_assignment::value>()); } } - void move_assign(table& x, true_type) + void move_assign(table& x, bool /* is_unique */, true_type) { delete_buckets(); set_hash_functions new_func_this(*this, x); @@ -3197,7 +3199,7 @@ struct table : boost::unordered::detail::functions struct map typedef boost::unordered::detail::table table; typedef boost::unordered::detail::map_extractor extractor; - enum - { - is_unique = true - }; typedef typename boost::unordered::detail::pick_policy::type policy; @@ -71,10 +67,6 @@ struct multimap typedef boost::unordered::detail::table table; typedef boost::unordered::detail::map_extractor extractor; - enum - { - is_unique = false - }; typedef typename boost::unordered::detail::pick_policy::type policy; diff --git a/include/boost/unordered/detail/set.hpp b/include/boost/unordered/detail/set.hpp index edeeaa86..12949652 100644 --- a/include/boost/unordered/detail/set.hpp +++ b/include/boost/unordered/detail/set.hpp @@ -30,10 +30,6 @@ template struct set typedef boost::unordered::detail::table table; typedef boost::unordered::detail::set_extractor extractor; - enum - { - is_unique = true - }; typedef typename boost::unordered::detail::pick_policy::type policy; @@ -70,10 +66,6 @@ template struct multiset typedef boost::unordered::detail::table table; typedef boost::unordered::detail::set_extractor extractor; - enum - { - is_unique = false - }; typedef typename boost::unordered::detail::pick_policy::type policy; diff --git a/include/boost/unordered/unordered_map.hpp b/include/boost/unordered/unordered_map.hpp index b268cb19..d0e3eae6 100644 --- a/include/boost/unordered/unordered_map.hpp +++ b/include/boost/unordered/unordered_map.hpp @@ -146,7 +146,7 @@ template class unordered_map #if defined(BOOST_UNORDERED_USE_MOVE) unordered_map& operator=(BOOST_COPY_ASSIGN_REF(unordered_map) x) { - table_.assign(x.table_); + table_.assign(x.table_, true); return *this; } @@ -156,13 +156,13 @@ template class unordered_map // is_nothrow_move_assignable_v && // is_nothrow_move_assignable_v

) { - table_.move_assign(x.table_); + table_.move_assign(x.table_, true); return *this; } #else unordered_map& operator=(unordered_map const& x) { - table_.assign(x.table_); + table_.assign(x.table_, true); return *this; } @@ -173,7 +173,7 @@ template class unordered_map // is_nothrow_move_assignable_v && // is_nothrow_move_assignable_v

) { - table_.move_assign(x.table_); + table_.move_assign(x.table_, true); return *this; } #endif @@ -950,7 +950,7 @@ template class unordered_multimap #if defined(BOOST_UNORDERED_USE_MOVE) unordered_multimap& operator=(BOOST_COPY_ASSIGN_REF(unordered_multimap) x) { - table_.assign(x.table_); + table_.assign(x.table_, false); return *this; } @@ -960,13 +960,13 @@ template class unordered_multimap // is_nothrow_move_assignable_v && // is_nothrow_move_assignable_v

) { - table_.move_assign(x.table_); + table_.move_assign(x.table_, false); return *this; } #else unordered_multimap& operator=(unordered_multimap const& x) { - table_.assign(x.table_); + table_.assign(x.table_, false); return *this; } @@ -977,7 +977,7 @@ template class unordered_multimap // is_nothrow_move_assignable_v && // is_nothrow_move_assignable_v

) { - table_.move_assign(x.table_); + table_.move_assign(x.table_, false); return *this; } #endif diff --git a/include/boost/unordered/unordered_set.hpp b/include/boost/unordered/unordered_set.hpp index b5775a77..1821b3ca 100644 --- a/include/boost/unordered/unordered_set.hpp +++ b/include/boost/unordered/unordered_set.hpp @@ -144,7 +144,7 @@ template class unordered_set #if defined(BOOST_UNORDERED_USE_MOVE) unordered_set& operator=(BOOST_COPY_ASSIGN_REF(unordered_set) x) { - table_.assign(x.table_); + table_.assign(x.table_, true); return *this; } @@ -154,13 +154,13 @@ template class unordered_set // is_nothrow_move_assignable_v && // is_nothrow_move_assignable_v

) { - table_.move_assign(x.table_); + table_.move_assign(x.table_, true); return *this; } #else unordered_set& operator=(unordered_set const& x) { - table_.assign(x.table_); + table_.assign(x.table_, true); return *this; } @@ -171,7 +171,7 @@ template class unordered_set // is_nothrow_move_assignable_v && // is_nothrow_move_assignable_v

) { - table_.move_assign(x.table_); + table_.move_assign(x.table_, true); return *this; } #endif @@ -654,7 +654,7 @@ template class unordered_multiset #if defined(BOOST_UNORDERED_USE_MOVE) unordered_multiset& operator=(BOOST_COPY_ASSIGN_REF(unordered_multiset) x) { - table_.assign(x.table_); + table_.assign(x.table_, false); return *this; } @@ -664,13 +664,13 @@ template class unordered_multiset // is_nothrow_move_assignable_v && // is_nothrow_move_assignable_v

) { - table_.move_assign(x.table_); + table_.move_assign(x.table_, false); return *this; } #else unordered_multiset& operator=(unordered_multiset const& x) { - table_.assign(x.table_); + table_.assign(x.table_, false); return *this; } @@ -681,7 +681,7 @@ template class unordered_multiset // is_nothrow_move_assignable_v && // is_nothrow_move_assignable_v

) { - table_.move_assign(x.table_); + table_.move_assign(x.table_, false); return *this; } #endif