diff --git a/include/boost/unordered/unordered_flat_set.hpp b/include/boost/unordered/unordered_flat_set.hpp index 1599ba55..d88c582c 100644 --- a/include/boost/unordered/unordered_flat_set.hpp +++ b/include/boost/unordered/unordered_flat_set.hpp @@ -30,17 +30,50 @@ namespace boost { #pragma warning(disable : 4714) /* marked as __forceinline not inlined */ #endif - template - class unordered_flat_set - { - struct set_types + namespace detail { + template struct flat_set_types { using key_type = Key; using init_type = Key; using value_type = Key; + static Key const& extract(value_type const& key) { return key; } - static Key&& move(value_type& x) { return std::move(x); } + + using element_type = value_type; + + static Key& value_from(element_type& x) { return x; } + + static element_type&& move(element_type& x) { return std::move(x); } + + template + static void construct(A& al, element_type* p, element_type const& copy) + { + boost::allocator_construct(al, p, copy); + } + + template + static void construct(A& al, element_type* p, Key&& x) + { + boost::allocator_construct(al, p, std::move(x)); + } + + template + static void construct(A& al, element_type* p, Args&&... args) + { + boost::allocator_construct(al, p, std::forward(args)...); + } + + template static void destroy(A& al, element_type* p) noexcept + { + boost::allocator_destroy(al, p); + } }; + } // namespace detail + + template + class unordered_flat_set + { + using set_types = detail::flat_set_types; using table_type = detail::foa::table