update boost on linux
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include <boost/heap/detail/heap_node.hpp>
|
||||
#include <boost/heap/detail/stable_heap.hpp>
|
||||
#include <boost/heap/detail/tree_iterator.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
@@ -48,7 +49,7 @@ struct make_binomial_heap_base
|
||||
{
|
||||
static const bool constant_time_size = parameter::binding<Parspec,
|
||||
tag::constant_time_size,
|
||||
boost::mpl::true_
|
||||
boost::true_type
|
||||
>::type::value;
|
||||
typedef typename detail::make_heap_base<T, Parspec, constant_time_size>::type base_type;
|
||||
typedef typename detail::make_heap_base<T, Parspec, constant_time_size>::allocator_argument allocator_argument;
|
||||
@@ -56,7 +57,11 @@ struct make_binomial_heap_base
|
||||
|
||||
typedef parent_pointing_heap_node<typename base_type::internal_type> 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
|
||||
|
||||
struct type:
|
||||
base_type,
|
||||
@@ -157,8 +162,14 @@ private:
|
||||
typedef typename base_maker::allocator_type allocator_type;
|
||||
typedef typename base_maker::node_type node;
|
||||
|
||||
#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 detail::node_handle<node_pointer, super_t, reference> handle_type;
|
||||
|
||||
@@ -199,6 +210,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;
|
||||
@@ -303,7 +317,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
|
||||
@@ -346,9 +365,14 @@ public:
|
||||
* */
|
||||
handle_type push(value_type const & v)
|
||||
{
|
||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
||||
node_pointer n = allocator_type::allocate(1);
|
||||
new(n) node_type(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
|
||||
insert_node(trees.begin(), n);
|
||||
|
||||
if (!top_element || super_t::operator()(top_element->value, n->value))
|
||||
@@ -369,9 +393,14 @@ public:
|
||||
template <class... Args>
|
||||
handle_type emplace(Args&&... args)
|
||||
{
|
||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
||||
node_pointer n = allocator_type::allocate(1);
|
||||
new(n) node_type(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
|
||||
insert_node(trees.begin(), n);
|
||||
|
||||
if (!top_element || super_t::operator()(top_element->value, n->value))
|
||||
@@ -421,8 +450,14 @@ public:
|
||||
else
|
||||
update_top_element();
|
||||
|
||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
||||
element->~node_type();
|
||||
allocator_type::deallocate(element, 1);
|
||||
#else
|
||||
allocator_type& alloc = *this;
|
||||
allocator_traits::destroy(alloc, element);
|
||||
allocator_traits::deallocate(alloc, element, 1);
|
||||
#endif
|
||||
sanity_check();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user