forked from boostorg/container
Fixes #206 ("operator-> on static_vector::iterator causes cast alignment warning")
This commit is contained in:
@@ -39,6 +39,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/detail/minimal_pair_header.hpp> //pair
|
||||
#include <boost/intrusive/detail/minimal_less_equal_header.hpp>//less, equal
|
||||
@@ -61,12 +62,12 @@ namespace dtl{
|
||||
|
||||
template<class D, class S>
|
||||
BOOST_CONTAINER_FORCEINLINE static D &force(S &s)
|
||||
{ return *reinterpret_cast<D*>(&s); }
|
||||
{ return *move_detail::force_ptr<D*>(&s); }
|
||||
|
||||
template<class D, class S>
|
||||
BOOST_CONTAINER_FORCEINLINE static D force_copy(const S &s)
|
||||
{
|
||||
const D *const vp = reinterpret_cast<const D *>(&s);
|
||||
const D *const vp = move_detail::force_ptr<const D *>(&s);
|
||||
D ret_val(*vp);
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user