From 6b6dde4f973ffd307dc7231e4c5419f19702e78e Mon Sep 17 00:00:00 2001 From: joaquintides Date: Sun, 23 Jul 2023 10:49:53 +0200 Subject: [PATCH] stylistic --- include/boost/unordered/detail/foa/concurrent_table.hpp | 7 ++++--- include/boost/unordered/detail/foa/table.hpp | 9 ++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/boost/unordered/detail/foa/concurrent_table.hpp b/include/boost/unordered/detail/foa/concurrent_table.hpp index 5fcb6ace..15aec185 100644 --- a/include/boost/unordered/detail/foa/concurrent_table.hpp +++ b/include/boost/unordered/detail/foa/concurrent_table.hpp @@ -372,7 +372,7 @@ inline void swap(atomic_size_control& x,atomic_size_control& y) * - Parallel versions of [c]visit_all(f) and erase_if(f) are provided based * on C++17 stdlib parallel algorithms. * - * Consult boost::unordered_flat_map docs for the full API reference. + * Consult boost::concurrent_flat_map docs for the full API reference. * Heterogeneous lookup is suported by default, that is, without checking for * any ::is_transparent typedefs --this checking is done by the wrapping * containers. @@ -430,6 +430,8 @@ class concurrent_table: using prober=typename super::prober; using arrays_type=typename super::arrays_type; using size_ctrl_type=typename super::size_ctrl_type; + using compatible_nonconcurrent_table=table; + friend class compatible_nonconcurrent_table; public: using key_type=typename super::key_type; @@ -465,7 +467,7 @@ public: concurrent_table(concurrent_table&& x,const Allocator& al_): concurrent_table(std::move(x),al_,x.exclusive_access()){} - concurrent_table(table&& x): + concurrent_table(compatible_nonconcurrent_table&& x): super{ std::move(x.h()),std::move(x.pred()),std::move(x.al()), arrays_type(arrays_type::new_group_access( @@ -905,7 +907,6 @@ public: private: template friend class concurrent_table; - template friend class table; using mutex_type=rw_spinlock; using multimutex_type=multimutex; // TODO: adapt 128 to the machine diff --git a/include/boost/unordered/detail/foa/table.hpp b/include/boost/unordered/detail/foa/table.hpp index 2a8a0b5e..d8968623 100644 --- a/include/boost/unordered/detail/foa/table.hpp +++ b/include/boost/unordered/detail/foa/table.hpp @@ -290,6 +290,9 @@ class table:table_core_impl using arrays_type=typename super::arrays_type; using size_ctrl_type=typename super::size_ctrl_type; using locator=typename super::locator; + using compatible_concurrent_table= + concurrent_table; + friend class compatible_concurrent_table; public: using key_type=typename super::key_type; @@ -328,7 +331,7 @@ public: table(table&& x)=default; table(const table& x,const Allocator& al_):super{x,al_}{} table(table&& x,const Allocator& al_):super{std::move(x),al_}{} - table(concurrent_table&& x): + table(compatible_concurrent_table&& x): table(std::move(x),x.exclusive_access()){} ~table()=default; @@ -503,10 +506,6 @@ public: friend bool operator!=(const table& x,const table& y){return !(x==y);} private: - template friend class concurrent_table; - using compatible_concurrent_table= - concurrent_table; - template table(compatible_concurrent_table&& x,ExclusiveLockGuard): super{