Add missing calls to as_const(), otherwise we may call a 'T(T&)' constructor instead of the intended 'T(T const&)'

This commit is contained in:
Braden Ganetsky
2024-08-07 16:15:36 -05:00
parent 793fad5620
commit a14b159665
2 changed files with 4 additions and 2 deletions

View File

@ -8,6 +8,7 @@
#include <boost/unordered/detail/foa/element_type.hpp>
#include <boost/unordered/detail/foa/types_constructibility.hpp>
#include <boost/unordered/detail/type_traits.hpp>
#include <boost/core/allocator_access.hpp>
#include <boost/core/no_exceptions_support.hpp>
@ -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 <class A, class... Args>

View File

@ -7,6 +7,7 @@
#include <boost/unordered/detail/foa/element_type.hpp>
#include <boost/unordered/detail/foa/types_constructibility.hpp>
#include <boost/unordered/detail/type_traits.hpp>
#include <boost/core/allocator_access.hpp>
#include <boost/core/no_exceptions_support.hpp>
@ -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 <typename Allocator>