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

This commit is contained in:
Ion Gaztañaga committed 2021-12-28 15:17:15 +01:00
1 parent ea3521bf14
commit 3f76f9fdf7
23 files changed
+124 -93

No files matched your search

+10 -9
View File
@@ -43,6 +43,7 @@
# include <boost/move/detail/fwd_macros.hpp>
#endif
#include <boost/move/detail/move_helpers.hpp>
#include <boost/move/detail/force_ptr.hpp>
// intrusive
#include <boost/intrusive/pointer_traits.hpp>
@@ -86,31 +87,31 @@ struct list_node
# endif
BOOST_CONTAINER_FORCEINLINE T &get_data()
{ return *reinterpret_cast<T*>(this->m_storage.data); }
{ return *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 *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 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 move_detail::force_ptr<T*>(this->m_storage.data); }
BOOST_CONTAINER_FORCEINLINE internal_type &get_real_data()
{ return *reinterpret_cast<internal_type*>(this->m_storage.data); }
{ return *move_detail::force_ptr<internal_type*>(this->m_storage.data); }
BOOST_CONTAINER_FORCEINLINE const internal_type &get_real_data() const
{ return *reinterpret_cast<const internal_type*>(this->m_storage.data); }
{ return *move_detail::force_ptr<const internal_type*>(this->m_storage.data); }
BOOST_CONTAINER_FORCEINLINE internal_type *get_real_data_ptr()
{ return reinterpret_cast<internal_type*>(this->m_storage.data); }
{ return move_detail::force_ptr<internal_type*>(this->m_storage.data); }
BOOST_CONTAINER_FORCEINLINE const internal_type *get_real_data_ptr() const
{ return reinterpret_cast<internal_type*>(this->m_storage.data); }
{ return move_detail::force_ptr<internal_type*>(this->m_storage.data); }
BOOST_CONTAINER_FORCEINLINE ~list_node()
{ reinterpret_cast<T*>(this->m_storage.data)->~T(); }
{ move_detail::force_ptr<T*>(this->m_storage.data)->~T(); }
#if defined(BOOST_CONTAINER_DISABLE_ALIASING_WARNING)
#pragma GCC diagnostic pop