forked from boostorg/unordered
Remove Types::is_unique
This commit is contained in:
@ -3116,16 +3116,17 @@ struct table : boost::unordered::detail::functions<typename Types::hasher,
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Assignment
|
||||
|
||||
void assign(table const& x)
|
||||
void assign(table const& x, bool is_unique)
|
||||
{
|
||||
if (this != boost::addressof(x)) {
|
||||
assign(x, boost::unordered::detail::integral_constant<bool,
|
||||
allocator_traits<node_allocator>::
|
||||
propagate_on_container_copy_assignment::value>());
|
||||
assign(x, is_unique,
|
||||
boost::unordered::detail::integral_constant<bool,
|
||||
allocator_traits<node_allocator>::
|
||||
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<typename Types::hasher,
|
||||
|
||||
new_func_this.commit();
|
||||
|
||||
if (Types::is_unique) {
|
||||
if (is_unique) {
|
||||
assign_buckets_unique(x);
|
||||
} else {
|
||||
assign_buckets_equiv(x);
|
||||
}
|
||||
}
|
||||
|
||||
void assign(table const& x, true_type)
|
||||
void assign(table const& x, bool is_unique, true_type)
|
||||
{
|
||||
if (node_alloc() == x.node_alloc()) {
|
||||
allocators_.assign(x.allocators_);
|
||||
assign(x, false_type());
|
||||
assign(x, is_unique, false_type());
|
||||
} else {
|
||||
set_hash_functions new_func_this(*this, x);
|
||||
|
||||
@ -3167,7 +3168,7 @@ struct table : boost::unordered::detail::functions<typename Types::hasher,
|
||||
|
||||
// Finally copy the elements.
|
||||
if (x.size_) {
|
||||
if (Types::is_unique) {
|
||||
if (is_unique) {
|
||||
copy_buckets_unique(x);
|
||||
} else {
|
||||
copy_buckets_equiv(x);
|
||||
@ -3176,17 +3177,18 @@ struct table : boost::unordered::detail::functions<typename Types::hasher,
|
||||
}
|
||||
}
|
||||
|
||||
void move_assign(table& x)
|
||||
void move_assign(table& x, bool is_unique)
|
||||
{
|
||||
if (this != boost::addressof(x)) {
|
||||
move_assign(
|
||||
x, boost::unordered::detail::integral_constant<bool,
|
||||
allocator_traits<node_allocator>::
|
||||
propagate_on_container_move_assignment::value>());
|
||||
x, is_unique,
|
||||
boost::unordered::detail::integral_constant<bool,
|
||||
allocator_traits<node_allocator>::
|
||||
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<typename Types::hasher,
|
||||
new_func_this.commit();
|
||||
}
|
||||
|
||||
void move_assign(table& x, false_type)
|
||||
void move_assign(table& x, bool is_unique, false_type)
|
||||
{
|
||||
if (node_alloc() == x.node_alloc()) {
|
||||
delete_buckets();
|
||||
@ -3219,7 +3221,7 @@ struct table : boost::unordered::detail::functions<typename Types::hasher,
|
||||
|
||||
new_func_this.commit();
|
||||
|
||||
if (Types::is_unique) {
|
||||
if (is_unique) {
|
||||
move_assign_buckets_unique(x);
|
||||
} else {
|
||||
move_assign_buckets_equiv(x);
|
||||
|
@ -30,10 +30,6 @@ template <typename A, typename K, typename M, typename H, typename P> struct map
|
||||
|
||||
typedef boost::unordered::detail::table<types> table;
|
||||
typedef boost::unordered::detail::map_extractor<value_type> extractor;
|
||||
enum
|
||||
{
|
||||
is_unique = true
|
||||
};
|
||||
|
||||
typedef typename boost::unordered::detail::pick_policy<K>::type policy;
|
||||
|
||||
@ -71,10 +67,6 @@ struct multimap
|
||||
|
||||
typedef boost::unordered::detail::table<types> table;
|
||||
typedef boost::unordered::detail::map_extractor<value_type> extractor;
|
||||
enum
|
||||
{
|
||||
is_unique = false
|
||||
};
|
||||
|
||||
typedef typename boost::unordered::detail::pick_policy<K>::type policy;
|
||||
|
||||
|
@ -30,10 +30,6 @@ template <typename A, typename T, typename H, typename P> struct set
|
||||
|
||||
typedef boost::unordered::detail::table<types> table;
|
||||
typedef boost::unordered::detail::set_extractor<value_type> extractor;
|
||||
enum
|
||||
{
|
||||
is_unique = true
|
||||
};
|
||||
|
||||
typedef typename boost::unordered::detail::pick_policy<T>::type policy;
|
||||
|
||||
@ -70,10 +66,6 @@ template <typename A, typename T, typename H, typename P> struct multiset
|
||||
|
||||
typedef boost::unordered::detail::table<types> table;
|
||||
typedef boost::unordered::detail::set_extractor<value_type> extractor;
|
||||
enum
|
||||
{
|
||||
is_unique = false
|
||||
};
|
||||
|
||||
typedef typename boost::unordered::detail::pick_policy<T>::type policy;
|
||||
|
||||
|
@ -146,7 +146,7 @@ template <class K, class T, class H, class P, class A> 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 K, class T, class H, class P, class A> class unordered_map
|
||||
// is_nothrow_move_assignable_v<H> &&
|
||||
// is_nothrow_move_assignable_v<P>)
|
||||
{
|
||||
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 K, class T, class H, class P, class A> class unordered_map
|
||||
// is_nothrow_move_assignable_v<H> &&
|
||||
// is_nothrow_move_assignable_v<P>)
|
||||
{
|
||||
table_.move_assign(x.table_);
|
||||
table_.move_assign(x.table_, true);
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
@ -950,7 +950,7 @@ template <class K, class T, class H, class P, class A> 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 K, class T, class H, class P, class A> class unordered_multimap
|
||||
// is_nothrow_move_assignable_v<H> &&
|
||||
// is_nothrow_move_assignable_v<P>)
|
||||
{
|
||||
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 K, class T, class H, class P, class A> class unordered_multimap
|
||||
// is_nothrow_move_assignable_v<H> &&
|
||||
// is_nothrow_move_assignable_v<P>)
|
||||
{
|
||||
table_.move_assign(x.table_);
|
||||
table_.move_assign(x.table_, false);
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
@ -144,7 +144,7 @@ template <class T, class H, class P, class A> 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 T, class H, class P, class A> class unordered_set
|
||||
// is_nothrow_move_assignable_v<H> &&
|
||||
// is_nothrow_move_assignable_v<P>)
|
||||
{
|
||||
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 T, class H, class P, class A> class unordered_set
|
||||
// is_nothrow_move_assignable_v<H> &&
|
||||
// is_nothrow_move_assignable_v<P>)
|
||||
{
|
||||
table_.move_assign(x.table_);
|
||||
table_.move_assign(x.table_, true);
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
@ -654,7 +654,7 @@ template <class T, class H, class P, class A> 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 T, class H, class P, class A> class unordered_multiset
|
||||
// is_nothrow_move_assignable_v<H> &&
|
||||
// is_nothrow_move_assignable_v<P>)
|
||||
{
|
||||
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 T, class H, class P, class A> class unordered_multiset
|
||||
// is_nothrow_move_assignable_v<H> &&
|
||||
// is_nothrow_move_assignable_v<P>)
|
||||
{
|
||||
table_.move_assign(x.table_);
|
||||
table_.move_assign(x.table_, false);
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user