diff --git a/include/boost/unordered/detail/foa/concurrent_table.hpp b/include/boost/unordered/detail/foa/concurrent_table.hpp index 722baf47..54341396 100644 --- a/include/boost/unordered/detail/foa/concurrent_table.hpp +++ b/include/boost/unordered/detail/foa/concurrent_table.hpp @@ -126,7 +126,7 @@ template class shared_lock { public: - shared_lock(Mutex& m_)noexcept:m{m_}{m.lock_shared();} + shared_lock(Mutex& m_)noexcept:m(m_){m.lock_shared();} ~shared_lock()noexcept{if(owns)m.unlock_shared();} /* not used but VS in pre-C++17 mode needs to see it for RVO */ @@ -148,7 +148,7 @@ template class lock_guard { public: - lock_guard(Mutex& m_)noexcept:m{m_}{m.lock();} + lock_guard(Mutex& m_)noexcept:m(m_){m.lock();} ~lock_guard()noexcept{m.unlock();} /* not used but VS in pre-C++17 mode needs to see it for RVO */ @@ -1029,7 +1029,7 @@ private: erase_on_exit( concurrent_table& x_, group_type* pg_,unsigned int pos_,element_type* p_): - x{x_},pg{pg_},pos{pos_},p{p_}{} + x(x_),pg(pg_),pos(pos_),p(p_){} ~erase_on_exit(){if(!rollback_)x.super::erase(pg,pos,p);} void rollback(){rollback_=true;} @@ -1283,7 +1283,7 @@ private: struct reserve_size { - reserve_size(concurrent_table& x_):x{x_} + reserve_size(concurrent_table& x_):x(x_) { size_=++x.size_ctrl.size; } diff --git a/include/boost/unordered/detail/foa/core.hpp b/include/boost/unordered/detail/foa/core.hpp index 7842363e..c856c855 100644 --- a/include/boost/unordered/detail/foa/core.hpp +++ b/include/boost/unordered/detail/foa/core.hpp @@ -1043,7 +1043,13 @@ struct table_arrays initialize_groups( arrays.groups(),groups_size, std::integral_constant< - bool,std::is_trivially_constructible::value + bool, +#if BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION,<50000) + /* std::is_trivially_default_constructible not provided */ + std::has_trivial_default_constructor::value +#else + std::is_trivially_default_constructible::value +#endif >{}); arrays.groups()[groups_size-1].set_sentinel(); } @@ -2016,7 +2022,14 @@ private: copy_elements_array_from( x, std::integral_constant< - bool,std::is_trivially_copy_constructible::value + bool, +#if BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION,<50000) + /* std::is_trivially_copy_constructible not provided */ + std::is_copy_constructible::value&& + std::has_trivial_copy_constructor::value +#else + std::is_trivially_copy_constructible::value +#endif &&( is_std_allocator::value|| !alloc_has_construct::value) @@ -2060,7 +2073,13 @@ private: void copy_groups_array_from(const table_core& x) { copy_groups_array_from(x, std::integral_constant::value&& + std::has_trivial_copy_assign::value +#else std::is_trivially_copy_assignable::value +#endif >{} ); } diff --git a/include/boost/unordered/detail/foa/table.hpp b/include/boost/unordered/detail/foa/table.hpp index 78cfa3b1..7e14bc75 100644 --- a/include/boost/unordered/detail/foa/table.hpp +++ b/include/boost/unordered/detail/foa/table.hpp @@ -106,7 +106,7 @@ public: using element_type= typename std::conditional::type; - table_iterator()=default; + table_iterator():pc_{nullptr},p_{nullptr}{}; template::type* =nullptr> table_iterator(const table_iterator& x): pc_{x.pc_},p_{x.p_}{} @@ -133,10 +133,10 @@ private: template friend class table_erase_return_type; template friend class table; - table_iterator(group_type* pg,std::size_t n,const table_element_type* p): + table_iterator(group_type* pg,std::size_t n,const table_element_type* ptet): pc_{to_pointer( reinterpret_cast(const_cast(pg))+n)}, - p_{to_pointer(const_cast(p))} + p_{to_pointer(const_cast(ptet))} {} unsigned char* pc()const noexcept{return boost::to_address(pc_);} @@ -568,7 +568,7 @@ private: struct erase_on_exit { - erase_on_exit(table& x_,const_iterator it_):x{x_},it{it_}{} + erase_on_exit(table& x_,const_iterator it_):x(x_),it(it_){} ~erase_on_exit(){if(!rollback_)x.erase(it);} void rollback(){rollback_=true;}