From 2889aab2269a35b42b3cbf1d0de07833d23a98fd Mon Sep 17 00:00:00 2001 From: joaquintides Date: Wed, 28 Sep 2022 09:54:44 +0200 Subject: [PATCH] made dependency on size_policy minimum size explicit --- include/boost/unordered/detail/foa.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/boost/unordered/detail/foa.hpp b/include/boost/unordered/detail/foa.hpp index 4e635550..af100659 100644 --- a/include/boost/unordered/detail/foa.hpp +++ b/include/boost/unordered/detail/foa.hpp @@ -252,6 +252,8 @@ struct pow2_size_policy return std::size_t(1)<<(sizeof(std::size_t)*CHAR_BIT-size_index); } + static constexpr std::size_t min_size(){return 2;} + static inline std::size_t position(std::size_t hash,std::size_t size_index) { return hash>>size_index; @@ -699,8 +701,8 @@ private: using dummy_group_layout= typename std::remove_const::type; - static constexpr dummy_group_layout - storage[2]={group_type::dummy_group,group_type::dummy_group}; + static constexpr dummy_group_layout storage[size_policy::min_size()]= + {group_type::dummy_group,group_type::dummy_group}; return reinterpret_cast( const_cast(storage));