From cb4e636d7885ec0ad73ead94e7b677534837f687 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Wed, 4 Jan 2023 11:13:25 -0800 Subject: [PATCH] Implement new type policy requirements for flat containers --- include/boost/unordered/unordered_flat_map.hpp | 17 +++++++++++++++++ include/boost/unordered/unordered_flat_set.hpp | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/include/boost/unordered/unordered_flat_map.hpp b/include/boost/unordered/unordered_flat_map.hpp index 13ad9c90..04bbc55c 100644 --- a/include/boost/unordered/unordered_flat_map.hpp +++ b/include/boost/unordered/unordered_flat_map.hpp @@ -60,6 +60,23 @@ namespace boost { return {std::move(const_cast(x.first)), std::move(const_cast(x.second))}; } + + template + static void construct(A& al, storage_type* p, moved_type&& x) + { + boost::allocator_construct(al, p, std::move(x)); + } + + template + static void construct(A& al, storage_type* p, Args&&... args) + { + boost::allocator_construct(al, p, std::forward(args)...); + } + + template static void destroy(A& al, storage_type* p) noexcept + { + boost::allocator_destroy(al, p); + } }; using table_type = detail::foa::table + static void construct(A& al, storage_type* p, Key&& x) + { + boost::allocator_construct(al, p, std::move(x)); + } + + template + static void construct(A& al, storage_type* p, Args&&... args) + { + boost::allocator_construct(al, p, std::forward(args)...); + } + + template static void destroy(A& al, storage_type* p) noexcept + { + boost::allocator_destroy(al, p); + } }; using table_type = detail::foa::table