From 5a4071d4f0721d4e9923e1d04b59e740cbdeb82b Mon Sep 17 00:00:00 2001 From: joaquintides Date: Mon, 7 Nov 2022 13:47:43 +0100 Subject: [PATCH] silenced bogus CGG warning --- include/boost/unordered/detail/foa.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/boost/unordered/detail/foa.hpp b/include/boost/unordered/detail/foa.hpp index 57ce2196..cbf81a84 100644 --- a/include/boost/unordered/detail/foa.hpp +++ b/include/boost/unordered/detail/foa.hpp @@ -1533,8 +1533,13 @@ private: void copy_elements_array_from(const table& x,std::true_type /* -> memcpy */) { + /* reinterpret_cast: GCC may complain about value_type not being trivially + * copy-assignable when we're relying on trivial copy constructibility. + */ std::memcpy( - arrays.elements,x.arrays.elements,x.capacity()*sizeof(value_type)); + reinterpret_cast(arrays.elements), + reinterpret_cast(x.arrays.elements), + x.capacity()*sizeof(value_type)); } void copy_elements_array_from(const table& x,std::false_type /* -> manual */)