]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/heap/pairing_heap.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / heap / pairing_heap.hpp
index d402dfc414e1a5a2ef4b18c0b28a140f956285f8..c591cc9e80dbce40b351a0f90ab4210d2a2a4a54 100644 (file)
@@ -59,11 +59,7 @@ struct make_pairing_heap_base
 
     typedef heap_node<typename base_type::internal_type, false> node_type;
 
-#ifdef BOOST_NO_CXX11_ALLOCATOR
-    typedef typename allocator_argument::template rebind<node_type>::other allocator_type;
-#else
-    typedef typename std::allocator_traits<allocator_argument>::template rebind_alloc<node_type> allocator_type;
-#endif
+    typedef typename boost::allocator_rebind<allocator_argument, node_type>::type allocator_type;
 
     struct type:
         base_type,
@@ -163,14 +159,8 @@ private:
         typedef typename base_maker::compare_argument value_compare;
         typedef typename base_maker::allocator_type allocator_type;
 
-#ifdef BOOST_NO_CXX11_ALLOCATOR
-        typedef typename allocator_type::pointer node_pointer;
-        typedef typename allocator_type::const_pointer const_node_pointer;
-#else
-        typedef std::allocator_traits<allocator_type> allocator_traits;
-        typedef typename allocator_traits::pointer node_pointer;
-        typedef typename allocator_traits::const_pointer const_node_pointer;
-#endif
+        typedef typename boost::allocator_pointer<allocator_type>::type node_pointer;
+        typedef typename boost::allocator_const_pointer<allocator_type>::type const_node_pointer;
 
         typedef detail::heap_node_list node_list_type;
         typedef typename node_list_type::iterator node_list_iterator;
@@ -224,9 +214,6 @@ public:
     typedef typename implementation_defined::difference_type difference_type;
     typedef typename implementation_defined::value_compare value_compare;
     typedef typename implementation_defined::allocator_type allocator_type;
-#ifndef BOOST_NO_CXX11_ALLOCATOR
-    typedef typename implementation_defined::allocator_traits allocator_traits;
-#endif
     typedef typename implementation_defined::reference reference;
     typedef typename implementation_defined::const_reference const_reference;
     typedef typename implementation_defined::pointer pointer;
@@ -316,12 +303,8 @@ public:
     /// \copydoc boost::heap::priority_queue::max_size
     size_type max_size(void) const
     {
-#ifdef BOOST_NO_CXX11_ALLOCATOR
-        return allocator_type::max_size();
-#else
         const allocator_type& alloc = *this;
-        return allocator_traits::max_size(alloc);
-#endif
+        return boost::allocator_max_size(alloc);
     }
 
     /// \copydoc boost::heap::priority_queue::clear
@@ -331,14 +314,9 @@ public:
             return;
 
         root->template clear_subtree<allocator_type>(*this);
-#ifdef BOOST_NO_CXX11_ALLOCATOR
         root->~node();
-        allocator_type::deallocate(root, 1);
-#else
         allocator_type& alloc = *this;
-        allocator_traits::destroy(alloc, root);
-        allocator_traits::deallocate(alloc, root, 1);
-#endif
+        alloc.deallocate(root, 1);
         root = NULL;
         size_holder::set_size(0);
     }
@@ -379,14 +357,9 @@ public:
     {
         size_holder::increment();
 
-#ifdef BOOST_NO_CXX11_ALLOCATOR
-        node_pointer n = allocator_type::allocate(1);
-        new(n) node(super_t::make_node(v));
-#else
         allocator_type& alloc = *this;
-        node_pointer n = allocator_traits::allocate(alloc, 1);
-        allocator_traits::construct(alloc, n, super_t::make_node(v));
-#endif
+        node_pointer n = alloc.allocate(1);
+        new(n) node(super_t::make_node(v));
         merge_node(n);
         return handle_type(n);
     }
@@ -407,14 +380,9 @@ public:
     {
         size_holder::increment();
 
-#ifdef BOOST_NO_CXX11_ALLOCATOR
-        node_pointer n = allocator_type::allocate(1);
-        new(n) node(super_t::make_node(std::forward<Args>(args)...));
-#else
         allocator_type& alloc = *this;
-        node_pointer n = allocator_traits::allocate(alloc, 1);
-        allocator_traits::construct(alloc, n, super_t::make_node(std::forward<Args>(args)...));
-#endif
+        node_pointer n = alloc.allocate(1);
+        new(n) node(super_t::make_node(std::forward<Args>(args)...));
         merge_node(n);
         return handle_type(n);
     }
@@ -560,14 +528,9 @@ public:
         }
 
         size_holder::decrement();
-#ifdef BOOST_NO_CXX11_ALLOCATOR
         n->~node();
-        allocator_type::deallocate(n, 1);
-#else
         allocator_type& alloc = *this;
-        allocator_traits::destroy(alloc, n);
-        allocator_traits::deallocate(alloc, n, 1);
-#endif
+        alloc.deallocate(n, 1);
     }
 
     /// \copydoc boost::heap::priority_queue::begin