forked from boostorg/container
Clean force_ptr usage and use launder_cast
This commit is contained in:
1 parent
56cc38f761
commit
978bbb113a
17 files changed
+98
-75
No files matched your search
@@ -54,7 +54,7 @@
|
||||
#include <boost/move/utility_core.hpp>
|
||||
#include <boost/move/iterator.hpp>
|
||||
#include <boost/move/adl_move_swap.hpp>
|
||||
#include <boost/move/detail/force_ptr.hpp>
|
||||
#include <boost/move/detail/launder.hpp>
|
||||
// move/detail
|
||||
#include <boost/move/detail/move_helpers.hpp>
|
||||
#include <boost/move/detail/iterator_to_raw_pointer.hpp>
|
||||
@@ -166,19 +166,19 @@ struct node
|
||||
# endif
|
||||
|
||||
inline T &get_data()
|
||||
{ return *boost::move_detail::force_ptr<T*>(this->m_storage.data); }
|
||||
{ return *boost::move_detail::launder_cast<T*>(&this->m_storage); }
|
||||
|
||||
inline const T &get_data() const
|
||||
{ return *boost::move_detail::force_ptr<const T*>(this->m_storage.data); }
|
||||
{ return *boost::move_detail::launder_cast<const T*>(&this->m_storage); }
|
||||
|
||||
inline T *get_data_ptr()
|
||||
{ return boost::move_detail::force_ptr<T*>(this->m_storage.data); }
|
||||
{ return boost::move_detail::launder_cast<T*>(&this->m_storage); }
|
||||
|
||||
inline const T *get_data_ptr() const
|
||||
{ return boost::move_detail::force_ptr<const T*>(this->m_storage.data); }
|
||||
{ return boost::move_detail::launder_cast<const T*>(&this->m_storage); }
|
||||
|
||||
inline ~node()
|
||||
{ boost::move_detail::force_ptr<T*>(this->m_storage.data)->~T(); }
|
||||
{ boost::move_detail::launder_cast<T*>(&this->m_storage)->~T(); }
|
||||
|
||||
#if defined(BOOST_CONTAINER_DISABLE_ALIASING_WARNING)
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
Reference in new issue
Block a user