mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 03:17:15 +02:00
Implement new type policy requirements for flat containers
This commit is contained in:
@ -60,6 +60,23 @@ namespace boost {
|
|||||||
return {std::move(const_cast<raw_key_type&>(x.first)),
|
return {std::move(const_cast<raw_key_type&>(x.first)),
|
||||||
std::move(const_cast<raw_mapped_type&>(x.second))};
|
std::move(const_cast<raw_mapped_type&>(x.second))};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class A>
|
||||||
|
static void construct(A& al, storage_type* p, moved_type&& x)
|
||||||
|
{
|
||||||
|
boost::allocator_construct(al, p, std::move(x));
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class A, class... Args>
|
||||||
|
static void construct(A& al, storage_type* p, Args&&... args)
|
||||||
|
{
|
||||||
|
boost::allocator_construct(al, p, std::forward<Args>(args)...);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class A> static void destroy(A& al, storage_type* p) noexcept
|
||||||
|
{
|
||||||
|
boost::allocator_destroy(al, p);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
using table_type = detail::foa::table<map_types, Hash, KeyEqual,
|
using table_type = detail::foa::table<map_types, Hash, KeyEqual,
|
||||||
|
@ -44,6 +44,23 @@ namespace boost {
|
|||||||
|
|
||||||
static Key const& extract(value_type const& key) { return key; }
|
static Key const& extract(value_type const& key) { return key; }
|
||||||
static Key&& move(value_type& x) { return std::move(x); }
|
static Key&& move(value_type& x) { return std::move(x); }
|
||||||
|
|
||||||
|
template <class A>
|
||||||
|
static void construct(A& al, storage_type* p, Key&& x)
|
||||||
|
{
|
||||||
|
boost::allocator_construct(al, p, std::move(x));
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class A, class... Args>
|
||||||
|
static void construct(A& al, storage_type* p, Args&&... args)
|
||||||
|
{
|
||||||
|
boost::allocator_construct(al, p, std::forward<Args>(args)...);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class A> static void destroy(A& al, storage_type* p) noexcept
|
||||||
|
{
|
||||||
|
boost::allocator_destroy(al, p);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
using table_type = detail::foa::table<set_types, Hash, KeyEqual,
|
using table_type = detail::foa::table<set_types, Hash, KeyEqual,
|
||||||
|
Reference in New Issue
Block a user