]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/multi_index/detail/ord_index_node.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / multi_index / detail / ord_index_node.hpp
index 09627fd19cb44ccc6834eccb08ed6c2235d56660..0a816c5faad2de30a341e13f97d5f4534a26609a 100644 (file)
@@ -1,4 +1,4 @@
-/* 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)
@@ -42,8 +42,7 @@
 
 #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)
@@ -71,31 +70,29 @@ struct ordered_index_node_impl; /* fwd decl. */
 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_;}
@@ -134,14 +131,19 @@ private:
 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
     {
@@ -167,6 +169,7 @@ struct ordered_index_node_compressed_base
   struct parent_ref
   {
     parent_ref(uintptr_type* r_):r(r_){}
+    parent_ref(const parent_ref& x):r(x.r){}
     
     operator pointer()const
     {
@@ -577,7 +580,7 @@ template<typename AugmentPolicy,typename Super>
 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
@@ -585,7 +588,7 @@ struct ordered_index_node_trampoline:
 {
   typedef ordered_index_node_impl<
     AugmentPolicy,
-    typename boost::detail::allocator::rebind_to<
+    typename rebind_alloc_for<
       typename Super::allocator_type,
       char
     >::type
@@ -600,11 +603,13 @@ private:
   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();}