Simplify dependencies dropping Boost.Core

This commit is contained in:
Ion Gaztañaga committed 2023-02-01 23:00:23 +01:00
1 parent 70f756960e
commit 552688c7fc
35 files changed
+282 -263

No files matched your search

+10 -9
View File
@@ -30,7 +30,7 @@
#include <boost/move/utility_core.hpp>
#include <boost/move/adl_move_swap.hpp>
#include <boost/type_traits/aligned_storage.hpp>
#include <boost/container/detail/mpl.hpp>
#include <boost/assert.hpp>
@@ -112,15 +112,16 @@ class node_handle
BOOST_MOVABLE_BUT_NOT_COPYABLE(node_handle)
typedef typename nator_traits::pointer node_pointer;
typedef ::boost::aligned_storage
typedef typename dtl::aligned_storage
< sizeof(nallocator_type)
, boost::alignment_of<nallocator_type>::value> nalloc_storage_t;
, dtl::alignment_of<nallocator_type>::value
>::type nalloc_storage_t;
node_pointer m_ptr;
nalloc_storage_t m_nalloc_storage;
void move_construct_alloc(nallocator_type &al)
{ ::new(m_nalloc_storage.address(), boost_container_new_t()) nallocator_type(::boost::move(al)); }
{ ::new((void*)m_nalloc_storage.data, boost_container_new_t()) nallocator_type(::boost::move(al)); }
void destroy_deallocate_node()
{
@@ -132,7 +133,7 @@ class node_handle
void move_construct_end(OtherNodeHandle &nh)
{
if(m_ptr){
::new (m_nalloc_storage.address(), boost_container_new_t()) nallocator_type(::boost::move(nh.node_alloc()));
::new ((void*)m_nalloc_storage.data, boost_container_new_t()) nallocator_type(::boost::move(nh.node_alloc()));
node_handle_friend::destroy_alloc(nh);
node_handle_friend::get_node_pointer(nh) = node_pointer();
}
@@ -140,7 +141,7 @@ class node_handle
}
void destroy_alloc() BOOST_NOEXCEPT
{ static_cast<nallocator_type*>(m_nalloc_storage.address())->~nallocator_type(); }
{ static_cast<nallocator_type*>((void*)m_nalloc_storage.data)->~nallocator_type(); }
node_pointer &get_node_pointer() BOOST_NOEXCEPT
{ return m_ptr; }
@@ -161,7 +162,7 @@ class node_handle
: m_ptr(p)
{
if(m_ptr){
::new (m_nalloc_storage.address(), boost_container_new_t()) nallocator_type(al);
::new ((void*)m_nalloc_storage.data, boost_container_new_t()) nallocator_type(al);
}
}
@@ -374,7 +375,7 @@ class node_handle
nallocator_type &node_alloc() BOOST_NOEXCEPT
{
BOOST_ASSERT(!empty());
return *static_cast<nallocator_type*>(m_nalloc_storage.address());
return *static_cast<nallocator_type*>((void*)m_nalloc_storage.data);
}
@@ -384,7 +385,7 @@ class node_handle
const nallocator_type &node_alloc() const BOOST_NOEXCEPT
{
BOOST_ASSERT(!empty());
return *static_cast<const nallocator_type*>(m_nalloc_storage.address());
return *static_cast<const nallocator_type*>((const void*)m_nalloc_storage.data);
}
//! <b>Effects</b>: x.swap(y).