diff options
Diffstat (limited to 'boost/multi_index/detail/ord_index_impl.hpp')
-rw-r--r-- | boost/multi_index/detail/ord_index_impl.hpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/boost/multi_index/detail/ord_index_impl.hpp b/boost/multi_index/detail/ord_index_impl.hpp index 20ce663252..1093b87c99 100644 --- a/boost/multi_index/detail/ord_index_impl.hpp +++ b/boost/multi_index/detail/ord_index_impl.hpp @@ -1,4 +1,4 @@ -/* Copyright 2003-2017 Joaquin M Lopez Munoz. +/* Copyright 2003-2018 Joaquin M Lopez Munoz. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) @@ -43,6 +43,7 @@ #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */ #include <algorithm> #include <boost/call_traits.hpp> +#include <boost/core/addressof.hpp> #include <boost/detail/no_exceptions_support.hpp> #include <boost/detail/workaround.hpp> #include <boost/foreach_fwd.hpp> @@ -68,6 +69,7 @@ #include <boost/tuple/tuple.hpp> #include <boost/type_traits/is_same.hpp> #include <utility> +#include <memory> #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) #include <initializer_list> @@ -161,8 +163,13 @@ public: value_type,KeyFromValue,Compare> value_compare; typedef tuple<key_from_value,key_compare> ctor_args; typedef typename super::final_allocator_type allocator_type; +#ifdef BOOST_NO_CXX11_ALLOCATOR typedef typename allocator_type::reference reference; typedef typename allocator_type::const_reference const_reference; +#else + typedef value_type& reference; + typedef const value_type& const_reference; +#endif #if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE) typedef safe_mode::safe_iterator< @@ -176,8 +183,14 @@ public: typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; +#ifdef BOOST_NO_CXX11_ALLOCATOR typedef typename allocator_type::pointer pointer; typedef typename allocator_type::const_pointer const_pointer; +#else + typedef std::allocator_traits<allocator_type> allocator_traits; + typedef typename allocator_traits::pointer pointer; + typedef typename allocator_traits::const_pointer const_pointer; +#endif typedef typename boost::reverse_iterator<iterator> reverse_iterator; typedef typename @@ -267,12 +280,12 @@ public: iterator iterator_to(const value_type& x) { - return make_iterator(node_from_value<node_type>(&x)); + return make_iterator(node_from_value<node_type>(boost::addressof(x))); } const_iterator iterator_to(const value_type& x)const { - return make_iterator(node_from_value<node_type>(&x)); + return make_iterator(node_from_value<node_type>(boost::addressof(x))); } /* capacity */ |