diff --git a/include/boost/unordered/unordered_flat_map.hpp b/include/boost/unordered/unordered_flat_map.hpp index 758694a1..df2717c6 100644 --- a/include/boost/unordered/unordered_flat_map.hpp +++ b/include/boost/unordered/unordered_flat_map.hpp @@ -72,13 +72,9 @@ namespace boost { } template - static void construct(A& al, element_type* p, Args&&... args) + static void construct(A& al, value_type* p, Args&&... args) { - using alloc_type = - typename boost::allocator_rebind::type; - alloc_type alloc(al); - std::allocator_traits::construct( - alloc, p, std::forward(args)...); + boost::allocator_construct(al, p, std::forward(args)...); } template static void destroy(A& al, init_type* p) noexcept @@ -86,7 +82,7 @@ namespace boost { boost::allocator_destroy(al, p); } - template static void destroy(A& al, element_type* p) noexcept + template static void destroy(A& al, value_type* p) noexcept { boost::allocator_destroy(al, p); } diff --git a/include/boost/unordered/unordered_flat_set.hpp b/include/boost/unordered/unordered_flat_set.hpp index 8829742e..2138a9f3 100644 --- a/include/boost/unordered/unordered_flat_set.hpp +++ b/include/boost/unordered/unordered_flat_set.hpp @@ -46,12 +46,12 @@ namespace boost { static element_type&& move(element_type& x) { return std::move(x); } template - static void construct(A& al, element_type* p, Args&&... args) + static void construct(A& al, value_type* p, Args&&... args) { boost::allocator_construct(al, p, std::forward(args)...); } - template static void destroy(A& al, element_type* p) noexcept + template static void destroy(A& al, value_type* p) noexcept { boost::allocator_destroy(al, p); }