Fixes #206 ("operator-> on static_vector::iterator causes cast alignment warning")

This commit is contained in:
Ion Gaztañaga
2021-12-28 15:17:15 +01:00
parent ea3521bf14
commit 3f76f9fdf7
23 changed files with 124 additions and 93 deletions
+6 -5
View File
@@ -54,6 +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>
// move/detail
#include <boost/move/detail/move_helpers.hpp>
// other
@@ -165,19 +166,19 @@ struct node
# endif
BOOST_CONTAINER_FORCEINLINE T &get_data()
{ return *reinterpret_cast<T*>(this->m_storage.data); }
{ return *boost::move_detail::force_ptr<T*>(this->m_storage.data); }
BOOST_CONTAINER_FORCEINLINE const T &get_data() const
{ return *reinterpret_cast<const T*>(this->m_storage.data); }
{ return *boost::move_detail::force_ptr<const T*>(this->m_storage.data); }
BOOST_CONTAINER_FORCEINLINE T *get_data_ptr()
{ return reinterpret_cast<T*>(this->m_storage.data); }
{ return boost::move_detail::force_ptr<T*>(this->m_storage.data); }
BOOST_CONTAINER_FORCEINLINE const T *get_data_ptr() const
{ return reinterpret_cast<T*>(this->m_storage.data); }
{ return boost::move_detail::force_ptr<const T*>(this->m_storage.data); }
BOOST_CONTAINER_FORCEINLINE ~node()
{ reinterpret_cast<T*>(this->m_storage.data)->~T(); }
{ boost::move_detail::force_ptr<T*>(this->m_storage.data)->~T(); }
#if defined(BOOST_CONTAINER_DISABLE_ALIASING_WARNING)
#pragma GCC diagnostic pop