Changes to support -Wcast-align=strict

This commit is contained in:
Ion Gaztañaga
2021-12-28 15:09:07 +01:00
parent 22049ac0bd
commit 691154b887
2 changed files with 4 additions and 2 deletions

View File

@@ -3888,6 +3888,7 @@ to be inserted in intrusive containers are allocated using `std::vector` or `std
[section:release_notes_boost_1_79_00 Boost 1.79 Release]
* The library now compiles without warnings with GCC's -Wcast-align=strict
* Fixed bugs:
* [@https://github.com/boostorg/intrusive/pull/66 GitHub #66: ['Fix declaration of node shadowing member]]
* [@https://github.com/boostorg/intrusive/pull/70 GitHub #70: ['list: fix remove / remove_and_dispose]]

View File

@@ -24,6 +24,7 @@
#include <boost/config.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <boost/move/detail/placement_new.hpp>
#include <boost/move/detail/force_ptr.hpp>
namespace boost {
namespace intrusive {
@@ -63,7 +64,7 @@ class array_initializer
BOOST_CATCH(...){
while(i--){
init_buf -= sizeof(T);
((T*)init_buf)->~T();
move_detail::force_ptr<T*>(init_buf)->~T();
}
BOOST_RETHROW;
}
@@ -81,7 +82,7 @@ class array_initializer
char *init_buf = (char*)rawbuf + N*sizeof(T);
for(std::size_t i = 0; i != N; ++i){
init_buf -= sizeof(T);
((T*)init_buf)->~T();
move_detail::force_ptr<T*>(init_buf)->~T();
}
}