From 19202d2a8d124d236a398774570d67a32934fc47 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Sat, 1 Apr 2023 09:09:22 +0200 Subject: [PATCH] avoided memset-related GCC warning --- include/boost/unordered/detail/foa/core.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/boost/unordered/detail/foa/core.hpp b/include/boost/unordered/detail/foa/core.hpp index acbbc053..a7e73c85 100644 --- a/include/boost/unordered/detail/foa/core.hpp +++ b/include/boost/unordered/detail/foa/core.hpp @@ -980,11 +980,14 @@ struct table_arrays static void initialize_groups( group_type* groups_,std::size_t size,std::true_type /* memset */) { - /* Faster/not slower than manual, assumes all zeros is group_type's + /* memset faster/not slower than manual, assumes all zeros is group_type's * default layout. + * reinterpret_cast: GCC may complain about group_type not being trivially + * copy-assignable when we're relying on trivial copy constructibility. */ - std::memset(groups_,0,sizeof(group_type)*size); + std::memset( + reinterpret_cast(groups_),0,sizeof(group_type)*size); } static void initialize_groups(