diff --git a/include/boost/unordered/detail/foa/concurrent_table.hpp b/include/boost/unordered/detail/foa/concurrent_table.hpp index 0b8e9b22..6a366266 100644 --- a/include/boost/unordered/detail/foa/concurrent_table.hpp +++ b/include/boost/unordered/detail/foa/concurrent_table.hpp @@ -283,7 +283,7 @@ struct concurrent_table_arrays:table_arrays static concurrent_table_arrays new_group_access(group_access_allocator_type al,const super& x) { concurrent_table_arrays arrays{x,nullptr}; - if(!arrays.elements_&&std::is_same::value){ + if(!arrays.elements()&&std::is_same::value){ arrays.group_accesses_= dummy_group_accesses(); } @@ -306,7 +306,7 @@ struct concurrent_table_arrays:table_arrays static void delete_group_access(group_access_allocator_type al,concurrent_table_arrays& arrays)noexcept { - if(arrays.elements_){ + if(arrays.elements()){ boost::allocator_deallocate( al,arrays.group_accesses_,arrays.groups_size_mask+1); } @@ -477,7 +477,7 @@ public: typename arrays_type::super{ x.arrays.groups_size_index,x.arrays.groups_size_mask, boost::pointer_traits::pointer_to( - *reinterpret_cast(boost::to_address(x.arrays.groups_))), + *reinterpret_cast(x.arrays.groups())), x.arrays.elements_})), size_ctrl_type{x.size_ctrl.ml,x.size_ctrl.size}} { @@ -1403,7 +1403,7 @@ private: GroupAccessMode access_mode,ExecutionPolicy&& policy,F f)const ->decltype(f(nullptr,0,nullptr),void()) { - if(!this->arrays.elements_)return; + if(!this->arrays.elements())return; auto first=this->arrays.groups(), last=first+this->arrays.groups_size_mask+1; std::for_each(std::forward(policy),first,last, @@ -1425,7 +1425,7 @@ private: bool for_all_elements_while( GroupAccessMode access_mode,ExecutionPolicy&& policy,F f)const { - if(!this->arrays.elements_)return true; + if(!this->arrays.elements())return true; auto first=this->arrays.groups(), last=first+this->arrays.groups_size_mask+1; return std::all_of(std::forward(policy),first,last, diff --git a/include/boost/unordered/detail/foa/core.hpp b/include/boost/unordered/detail/foa/core.hpp index 731a1c9b..6954c77e 100644 --- a/include/boost/unordered/detail/foa/core.hpp +++ b/include/boost/unordered/detail/foa/core.hpp @@ -999,8 +999,7 @@ struct table_arrays std::is_trivially_constructible::value #endif >{}); - using difference_type=typename boost::pointer_traits::difference_type; - arrays.groups_[static_cast(groups_size-1)].set_sentinel(); + arrays.groups()[groups_size-1].set_sentinel(); } return arrays; } @@ -1010,7 +1009,7 @@ struct table_arrays using storage_traits=boost::allocator_traits; auto sal=allocator_type(al); - if(arrays.elements_){ + if(arrays.elements()){ storage_traits::deallocate( sal,arrays.elements_,buffer_size(arrays.groups_size_mask+1)); } @@ -1578,7 +1577,7 @@ public: std::size_t capacity()const noexcept { - return arrays.elements_?(arrays.groups_size_mask+1)*N-1:0; + return arrays.elements()?(arrays.groups_size_mask+1)*N-1:0; } float load_factor()const noexcept @@ -1900,7 +1899,7 @@ private: void fast_copy_elements_from(const table_core& x) { - if(arrays.elements_&&x.arrays.elements_){ + if(arrays.elements()&&x.arrays.elements()){ copy_elements_array_from(x); copy_groups_array_from(x); size_ctrl.ml=std::size_t(x.size_ctrl.ml); diff --git a/include/boost/unordered/detail/foa/table.hpp b/include/boost/unordered/detail/foa/table.hpp index 547d7c02..f82586a5 100644 --- a/include/boost/unordered/detail/foa/table.hpp +++ b/include/boost/unordered/detail/foa/table.hpp @@ -386,7 +386,7 @@ public: iterator begin()noexcept { iterator it{this->arrays.groups(),0,this->arrays.elements()}; - if(this->arrays.elements_&& + if(this->arrays.elements()&& !(this->arrays.groups()[0].match_occupied()&0x1))++it; return it; } @@ -556,7 +556,7 @@ private: arrays_type{ x.arrays.groups_size_index,x.arrays.groups_size_mask, boost::pointer_traits::pointer_to( - *reinterpret_cast(boost::to_address(x.arrays.groups_))), + *reinterpret_cast(x.arrays.groups())), x.arrays.elements_}, size_ctrl_type{ x.size_ctrl.ml,x.size_ctrl.size}}