mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 19:37:14 +02:00
Fix copy assignment warning in gcc
This commit is contained in:
@ -173,7 +173,15 @@ struct atomic_integral
|
||||
void operator|=(Integral m){n.fetch_or(m,std::memory_order_relaxed);}
|
||||
void operator&=(Integral m){n.fetch_and(m,std::memory_order_relaxed);}
|
||||
|
||||
atomic_integral& operator=(atomic_integral const& rhs) {
|
||||
if(this!=&rhs){
|
||||
n.store(rhs.n.load(std::memory_order_relaxed),std::memory_order_relaxed);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::atomic<Integral> n;
|
||||
|
||||
};
|
||||
|
||||
/* Group-level concurrency protection. It provides a rw mutex plus an
|
||||
|
@ -1773,9 +1773,7 @@ private:
|
||||
{
|
||||
if(arrays.elements){
|
||||
copy_elements_array_from(x);
|
||||
std::memcpy(
|
||||
arrays.groups,x.arrays.groups,
|
||||
(arrays.groups_size_mask+1)*sizeof(group_type));
|
||||
copy_groups_array_from(x);
|
||||
size_=std::size_t(x.size_);
|
||||
}
|
||||
}
|
||||
@ -1833,6 +1831,34 @@ private:
|
||||
BOOST_CATCH_END
|
||||
}
|
||||
|
||||
void copy_groups_array_from(const table_core& x) {
|
||||
copy_groups_array_from(x, std::integral_constant<bool,
|
||||
#if BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION,<50000)
|
||||
/* std::is_trivially_copyable not provided */
|
||||
boost::has_trivial_copy<element_type>::value
|
||||
#else
|
||||
std::is_trivially_copyable<element_type>::value
|
||||
#endif
|
||||
>{}
|
||||
);
|
||||
}
|
||||
|
||||
void copy_groups_array_from(
|
||||
const table_core& x, std::true_type /* -> memcpy */)
|
||||
{
|
||||
std::memcpy(
|
||||
arrays.groups,x.arrays.groups,
|
||||
(arrays.groups_size_mask+1)*sizeof(group_type));
|
||||
}
|
||||
|
||||
void copy_groups_array_from(
|
||||
const table_core& x, std::false_type /* -> manual */)
|
||||
{
|
||||
for(std::size_t i=0;i<arrays.groups_size_mask+1;++i){
|
||||
arrays.groups[i]=x.arrays.groups[i];
|
||||
}
|
||||
}
|
||||
|
||||
void recover_slot(unsigned char* pc)
|
||||
{
|
||||
/* If this slot potentially caused overflow, we decrease the maximum load so
|
||||
|
Reference in New Issue
Block a user