From 0ea2cb5a7a9b17c755ba85b6915a7a2de20efbe0 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Wed, 28 Sep 2022 11:47:23 +0200 Subject: [PATCH] refactored dummy_groups to avoid explicit array initialization --- include/boost/unordered/detail/foa.hpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/include/boost/unordered/detail/foa.hpp b/include/boost/unordered/detail/foa.hpp index 878a2073..41ca6089 100644 --- a/include/boost/unordered/detail/foa.hpp +++ b/include/boost/unordered/detail/foa.hpp @@ -76,6 +76,11 @@ struct group15 { static constexpr int N=15; + struct dummy_group_type + { + alignas(16) unsigned char storage[N+1]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}; + }; + inline void set(std::size_t pos,std::size_t hash) { BOOST_ASSERT(pos::type; - - static constexpr dummy_group_layout storage[size_policy::min_size()]= - {group_type::dummy_group,group_type::dummy_group}; - + static constexpr group_type::dummy_group_type storage[size_policy::min_size()]; return reinterpret_cast( - const_cast(storage)); + const_cast(storage)); } void delete_arrays(const arrays_info& arrays_)noexcept