mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 11:27:15 +02:00
Clean up usage of Allocators for flat containers
This commit is contained in:
@ -72,13 +72,9 @@ namespace boost {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class A, class... Args>
|
template <class A, class... Args>
|
||||||
static void construct(A& al, element_type* p, Args&&... args)
|
static void construct(A& al, value_type* p, Args&&... args)
|
||||||
{
|
{
|
||||||
using alloc_type =
|
boost::allocator_construct(al, p, std::forward<Args>(args)...);
|
||||||
typename boost::allocator_rebind<A, value_type>::type;
|
|
||||||
alloc_type alloc(al);
|
|
||||||
std::allocator_traits<alloc_type>::construct(
|
|
||||||
alloc, p, std::forward<Args>(args)...);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class A> static void destroy(A& al, init_type* p) noexcept
|
template <class A> static void destroy(A& al, init_type* p) noexcept
|
||||||
@ -86,7 +82,7 @@ namespace boost {
|
|||||||
boost::allocator_destroy(al, p);
|
boost::allocator_destroy(al, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class A> static void destroy(A& al, element_type* p) noexcept
|
template <class A> static void destroy(A& al, value_type* p) noexcept
|
||||||
{
|
{
|
||||||
boost::allocator_destroy(al, p);
|
boost::allocator_destroy(al, p);
|
||||||
}
|
}
|
||||||
|
@ -46,12 +46,12 @@ namespace boost {
|
|||||||
static element_type&& move(element_type& x) { return std::move(x); }
|
static element_type&& move(element_type& x) { return std::move(x); }
|
||||||
|
|
||||||
template <class A, class... Args>
|
template <class A, class... Args>
|
||||||
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>(args)...);
|
boost::allocator_construct(al, p, std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class A> static void destroy(A& al, element_type* p) noexcept
|
template <class A> static void destroy(A& al, value_type* p) noexcept
|
||||||
{
|
{
|
||||||
boost::allocator_destroy(al, p);
|
boost::allocator_destroy(al, p);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user