From a14b1596650d0c402b8af98f9df0477db9106b3a Mon Sep 17 00:00:00 2001 From: Braden Ganetsky Date: Wed, 7 Aug 2024 16:15:36 -0500 Subject: [PATCH] Add missing calls to as_const(), otherwise we may call a 'T(T&)' constructor instead of the intended 'T(T const&)' --- include/boost/unordered/detail/foa/node_map_types.hpp | 3 ++- include/boost/unordered/detail/foa/node_set_types.hpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/boost/unordered/detail/foa/node_map_types.hpp b/include/boost/unordered/detail/foa/node_map_types.hpp index 789251a6..f13a7a84 100644 --- a/include/boost/unordered/detail/foa/node_map_types.hpp +++ b/include/boost/unordered/detail/foa/node_map_types.hpp @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -72,7 +73,7 @@ namespace boost { static void construct( A& al, element_type* p, element_type const& copy) { - construct(al, p, *copy.p); + construct(al, p, detail::as_const(*copy.p)); } template diff --git a/include/boost/unordered/detail/foa/node_set_types.hpp b/include/boost/unordered/detail/foa/node_set_types.hpp index bc2ee8ac..da47793f 100644 --- a/include/boost/unordered/detail/foa/node_set_types.hpp +++ b/include/boost/unordered/detail/foa/node_set_types.hpp @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -39,7 +40,7 @@ namespace boost { static void construct( A& al, element_type* p, element_type const& copy) { - construct(al, p, *copy.p); + construct(al, p, detail::as_const(*copy.p)); } template