-/* Copyright 2003-2018 Joaquin M Lopez Munoz.
+/* Copyright 2003-2019 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)
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <cstddef>
-#include <memory>
-#include <boost/detail/allocator_utilities.hpp>
+#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/multi_index/detail/raw_ptr.hpp>
#if !defined(BOOST_MULTI_INDEX_DISABLE_COMPRESSED_ORDERED_INDEX_NODES)
template<typename AugmentPolicy,typename Allocator>
struct ordered_index_node_traits
{
- typedef typename
- boost::detail::allocator::rebind_to<
+ typedef typename rebind_alloc_for<
Allocator,
ordered_index_node_impl<AugmentPolicy,Allocator>
>::type allocator;
-#ifdef BOOST_NO_CXX11_ALLOCATOR
- typedef typename allocator::pointer pointer;
- typedef typename allocator::const_pointer const_pointer;
-#else
- typedef std::allocator_traits<allocator> allocator_traits;
- typedef typename allocator_traits::pointer pointer;
- typedef typename allocator_traits::const_pointer const_pointer;
-#endif
+ typedef allocator_traits<allocator> alloc_traits;
+ typedef typename alloc_traits::pointer pointer;
+ typedef typename alloc_traits::const_pointer const_pointer;
+ typedef typename alloc_traits::difference_type difference_type;
+ typedef typename alloc_traits::size_type size_type;
};
template<typename AugmentPolicy,typename Allocator>
struct ordered_index_node_std_base
{
typedef ordered_index_node_traits<
- AugmentPolicy,Allocator> node_traits;
- typedef typename node_traits::allocator node_allocator;
- typedef typename node_traits::pointer pointer;
- typedef typename node_traits::const_pointer const_pointer;
- typedef ordered_index_color& color_ref;
- typedef pointer& parent_ref;
+ AugmentPolicy,Allocator> node_traits;
+ typedef typename node_traits::allocator node_allocator;
+ typedef typename node_traits::pointer pointer;
+ typedef typename node_traits::const_pointer const_pointer;
+ typedef typename node_traits::difference_type difference_type;
+ typedef typename node_traits::size_type size_type;
+ typedef ordered_index_color& color_ref;
+ typedef pointer& parent_ref;
ordered_index_color& color(){return color_;}
ordered_index_color color()const{return color_;}
template<typename AugmentPolicy,typename Allocator>
struct ordered_index_node_compressed_base
{
+ typedef ordered_index_node_traits<
+ AugmentPolicy,Allocator> node_traits;
typedef ordered_index_node_impl<
- AugmentPolicy,Allocator>* pointer;
+ AugmentPolicy,Allocator>* pointer;
typedef const ordered_index_node_impl<
- AugmentPolicy,Allocator>* const_pointer;
+ AugmentPolicy,Allocator>* const_pointer;
+ typedef typename node_traits::difference_type difference_type;
+ typedef typename node_traits::size_type size_type;
struct color_ref
{
color_ref(uintptr_type* r_):r(r_){}
+ color_ref(const color_ref& x):r(x.r){}
operator ordered_index_color()const
{
struct parent_ref
{
parent_ref(uintptr_type* r_):r(r_){}
+ parent_ref(const parent_ref& x):r(x.r){}
operator pointer()const
{
struct ordered_index_node_trampoline:
ordered_index_node_impl<
AugmentPolicy,
- typename boost::detail::allocator::rebind_to<
+ typename rebind_alloc_for<
typename Super::allocator_type,
char
>::type
{
typedef ordered_index_node_impl<
AugmentPolicy,
- typename boost::detail::allocator::rebind_to<
+ typename rebind_alloc_for<
typename Super::allocator_type,
char
>::type
typedef ordered_index_node_trampoline<AugmentPolicy,Super> trampoline;
public:
- typedef typename trampoline::impl_type impl_type;
- typedef typename trampoline::color_ref impl_color_ref;
- typedef typename trampoline::parent_ref impl_parent_ref;
- typedef typename trampoline::pointer impl_pointer;
- typedef typename trampoline::const_pointer const_impl_pointer;
+ typedef typename trampoline::impl_type impl_type;
+ typedef typename trampoline::color_ref impl_color_ref;
+ typedef typename trampoline::parent_ref impl_parent_ref;
+ typedef typename trampoline::pointer impl_pointer;
+ typedef typename trampoline::const_pointer const_impl_pointer;
+ typedef typename trampoline::difference_type difference_type;
+ typedef typename trampoline::size_type size_type;
impl_color_ref color(){return trampoline::color();}
ordered_index_color color()const{return trampoline::color();}