X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fboost%2Fboost%2Fheap%2Ffibonacci_heap.hpp;h=c54fcb09d3df9383fc7c9948fa5b75f628bc2974;hb=92f5a8d42d07f9929ae4fa7e01342fe8d96808a8;hp=10a1ce3a5e156c001dd690d38d8e5b480c567c82;hpb=a0324939f9d0e1905d5df8f57442f09dc70af83d;p=ceph.git diff --git a/ceph/src/boost/boost/heap/fibonacci_heap.hpp b/ceph/src/boost/boost/heap/fibonacci_heap.hpp index 10a1ce3a5..c54fcb09d 100644 --- a/ceph/src/boost/boost/heap/fibonacci_heap.hpp +++ b/ceph/src/boost/boost/heap/fibonacci_heap.hpp @@ -20,6 +20,7 @@ #include #include #include +#include #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once @@ -50,7 +51,7 @@ struct make_fibonacci_heap_base { static const bool constant_time_size = parameter::binding::type::value; typedef typename detail::make_heap_base::type base_type; @@ -58,7 +59,11 @@ struct make_fibonacci_heap_base typedef typename detail::make_heap_base::compare_argument compare_argument; typedef marked_heap_node node_type; +#ifdef BOOST_NO_CXX11_ALLOCATOR typedef typename allocator_argument::template rebind::other allocator_type; +#else + typedef typename std::allocator_traits::template rebind_alloc allocator_type; +#endif struct type: base_type, @@ -154,8 +159,14 @@ 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_traits; + typedef typename allocator_traits::pointer node_pointer; + typedef typename allocator_traits::const_pointer const_node_pointer; +#endif typedef detail::heap_node_list node_list_type; typedef typename node_list_type::iterator node_list_iterator; @@ -201,6 +212,9 @@ 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; @@ -299,7 +313,12 @@ 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 } /// \copydoc boost::heap::priority_queue::clear @@ -347,9 +366,14 @@ 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 roots.push_front(*n); if (!top_element || super_t::operator()(top_element->value, n->value)) @@ -371,9 +395,14 @@ 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)...)); +#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)...)); +#endif roots.push_front(*n); if (!top_element || super_t::operator()(top_element->value, n->value)) @@ -741,8 +770,14 @@ private: { add_children_to_root(erased_node); +#ifdef BOOST_NO_CXX11_ALLOCATOR erased_node->~node(); allocator_type::deallocate(erased_node, 1); +#else + allocator_type& alloc = *this; + allocator_traits::destroy(alloc, erased_node); + allocator_traits::deallocate(alloc, erased_node, 1); +#endif size_holder::decrement(); if (!empty())