summaryrefslogtreecommitdiff
path: root/boost/multi_index/detail/index_base.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/multi_index/detail/index_base.hpp')
-rw-r--r--boost/multi_index/detail/index_base.hpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/boost/multi_index/detail/index_base.hpp b/boost/multi_index/detail/index_base.hpp
index 199b3bcb3f..22cf0f1402 100644
--- a/boost/multi_index/detail/index_base.hpp
+++ b/boost/multi_index/detail/index_base.hpp
@@ -14,6 +14,7 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
+#include <boost/core/addressof.hpp>
#include <boost/detail/allocator_utilities.hpp>
#include <boost/detail/no_exceptions_support.hpp>
#include <boost/detail/workaround.hpp>
@@ -102,7 +103,7 @@ protected:
{
x=final().allocate_node();
BOOST_TRY{
- boost::detail::allocator::construct(&x->value(),v);
+ boost::detail::allocator::construct(boost::addressof(x->value()),v);
}
BOOST_CATCH(...){
final().deallocate_node(x);
@@ -123,7 +124,8 @@ protected:
* perfect forwarding emulation of Boost.Move might break other libs.
*/
- new (&x->value()) value_type(boost::move(const_cast<value_type&>(v)));
+ new (boost::addressof(x->value()))
+ value_type(boost::move(const_cast<value_type&>(v)));
}
BOOST_CATCH(...){
final().deallocate_node(x);
@@ -158,12 +160,12 @@ protected:
void erase_(node_type* x)
{
- boost::detail::allocator::destroy(&x->value());
+ boost::detail::allocator::destroy(boost::addressof(x->value()));
}
void delete_node_(node_type* x)
{
- boost::detail::allocator::destroy(&x->value());
+ boost::detail::allocator::destroy(boost::addressof(x->value()));
}
void clear_(){}