Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76024 - in branches/release/boost/heap: . detail
From: tim_at_[hidden]
Date: 2011-12-17 11:51:57


Author: timblechmann
Date: 2011-12-17 11:51:56 EST (Sat, 17 Dec 2011)
New Revision: 76024
URL: http://svn.boost.org/trac/boost/changeset/76024

Log:
merge boost.heap from trunk

Properties modified:
   branches/release/boost/heap/ (props changed)
Text files modified:
   branches/release/boost/heap/binomial_heap.hpp | 16 +++++++++----
   branches/release/boost/heap/detail/mutable_heap.hpp | 8 +++---
   branches/release/boost/heap/detail/stable_heap.hpp | 47 +++++++++++++++++++++++++++++++++++++++
   branches/release/boost/heap/fibonacci_heap.hpp | 9 +++++++
   branches/release/boost/heap/heap_concepts.hpp | 10 +++++---
   branches/release/boost/heap/pairing_heap.hpp | 9 +++++++
   branches/release/boost/heap/policies.hpp | 2
   branches/release/boost/heap/skew_heap.hpp | 9 +++++++
   8 files changed, 95 insertions(+), 15 deletions(-)

Modified: branches/release/boost/heap/binomial_heap.hpp
==============================================================================
--- branches/release/boost/heap/binomial_heap.hpp (original)
+++ branches/release/boost/heap/binomial_heap.hpp 2011-12-17 11:51:56 EST (Sat, 17 Dec 2011)
@@ -71,6 +71,14 @@
         {
             base_type::operator=(std::move(static_cast<base_type&>(rhs)));
             allocator_type::operator=(std::move(static_cast<allocator_type&>(rhs)));
+ return *this;
+ }
+
+ type & operator=(type const & rhs)
+ {
+ base_type::operator=(static_cast<base_type const &>(rhs));
+ allocator_type::operator=(static_cast<allocator_type const &>(rhs));
+ return *this;
         }
 #endif
     };
@@ -215,6 +223,7 @@
             return;
 
         clone_forest(rhs);
+ size_holder::set_size(rhs.get_size());
     }
 
     /// \copydoc boost::heap::priority_queue::operator=(priority_queue const &)
@@ -350,7 +359,7 @@
     handle_type emplace(Args&&... args)
     {
         node_pointer n = allocator_type::allocate(1);
- new(n) node(super_t::make_node(std::forward<Args>(args)...));
+ new(n) node_type(super_t::make_node(std::forward<Args>(args)...));
 
         insert_node(trees.begin(), n);
 
@@ -619,7 +628,6 @@
         BOOST_HEAP_ASSERT (!rhs.empty());
 
         node_list_iterator this_iterator = trees.begin();
- node_list_iterator rhs_iterator = rhs.trees.begin();
         node_pointer carry_node = NULL;
 
         while (!rhs.trees.empty()) {
@@ -745,7 +753,6 @@
     {
         while (n->parent) {
             node_pointer parent = n->parent;
- int parent_children = parent->child_count();
             node_pointer grand_parent = parent->parent;
             if (cmp(n->value, parent->value))
                 return;
@@ -764,8 +771,7 @@
                 trees.insert(it, *n);
             }
             n->add_child(parent);
- int n_children = n->child_count();
- BOOST_HEAP_ASSERT(parent_children == n_children);
+ BOOST_HEAP_ASSERT(parent->child_count() == n->child_count());
         }
     }
 

Modified: branches/release/boost/heap/detail/mutable_heap.hpp
==============================================================================
--- branches/release/boost/heap/detail/mutable_heap.hpp (original)
+++ branches/release/boost/heap/detail/mutable_heap.hpp 2011-12-17 11:51:56 EST (Sat, 17 Dec 2011)
@@ -152,7 +152,7 @@
         q_(std::move(rhs.q_)), objects(std::move(rhs.objects))
     {}
 
- priority_queue_mutable_wrapper & operator=(priority_queue_mutabe_wrapper && rhs)
+ priority_queue_mutable_wrapper & operator=(priority_queue_mutable_wrapper && rhs)
     {
         q_ = std::move(rhs.q_);
         objects = std::move(rhs.objects);
@@ -214,15 +214,15 @@
 
     public:
         ordered_iterator(void):
- adaptor_type(0), q_(NULL), unvisited_nodes(indirect_cmp())
+ adaptor_type(0), unvisited_nodes(indirect_cmp()), q_(NULL)
         {}
 
         ordered_iterator(const priority_queue_mutable_wrapper * q, indirect_cmp const & cmp):
- adaptor_type(0), q_(q), unvisited_nodes(cmp)
+ adaptor_type(0), unvisited_nodes(cmp), q_(q)
         {}
 
         ordered_iterator(const_list_iterator it, const priority_queue_mutable_wrapper * q, indirect_cmp const & cmp):
- adaptor_type(it), q_(q), unvisited_nodes(cmp)
+ adaptor_type(it), unvisited_nodes(cmp), q_(q)
         {
             if (it != q->objects.end())
                 discover_nodes(it);

Modified: branches/release/boost/heap/detail/stable_heap.hpp
==============================================================================
--- branches/release/boost/heap/detail/stable_heap.hpp (original)
+++ branches/release/boost/heap/detail/stable_heap.hpp 2011-12-17 11:51:56 EST (Sat, 17 Dec 2011)
@@ -42,10 +42,21 @@
         rhs.size_ = 0;
     }
 
+ size_holder(size_holder const & rhs):
+ size_(rhs.size_)
+ {}
+
     size_holder & operator=(size_holder && rhs)
     {
         size_ = rhs.size_;
         rhs.size_ = 0;
+ return *this;
+ }
+
+ size_holder & operator=(size_holder const & rhs)
+ {
+ size_ = rhs.size_;
+ return *this;
     }
 #endif
 
@@ -86,8 +97,18 @@
     size_holder(size_holder && rhs)
     {}
 
- size_holder & operator=(size_holder && rhs)
+ size_holder(size_holder const & rhs)
     {}
+
+ size_holder & operator=(size_holder && rhs)
+ {
+ return *this;
+ }
+
+ size_holder & operator=(size_holder const & rhs)
+ {
+ return *this;
+ }
 #endif
 
     size_type get_size() const
@@ -140,10 +161,23 @@
         size_holder_type(std::move(static_cast<size_holder_type&>(rhs)))
     {}
 
+ heap_base(heap_base const & rhs):
+ Cmp(static_cast<Cmp const &>(rhs)),
+ size_holder_type(static_cast<size_holder_type const &>(rhs))
+ {}
+
     heap_base & operator=(heap_base && rhs)
     {
         Cmp::operator=(std::move(static_cast<Cmp&>(rhs)));
         size_holder_type::operator=(std::move(static_cast<size_holder_type&>(rhs)));
+ return *this;
+ }
+
+ heap_base & operator=(heap_base const & rhs)
+ {
+ Cmp::operator=(static_cast<Cmp const &>(rhs));
+ size_holder_type::operator=(static_cast<size_holder_type const &>(rhs));
+ return *this;
     }
 #endif
 
@@ -236,7 +270,18 @@
 
         counter_ = rhs.counter_;
         rhs.counter_ = 0;
+ return *this;
+ }
+
+ heap_base & operator=(heap_base const & rhs)
+ {
+ Cmp::operator=(static_cast<Cmp const &>(rhs));
+ size_holder_type::operator=(static_cast<size_holder_type const &>(rhs));
+
+ counter_ = rhs.counter_;
+ return *this;
     }
+
 #endif
 
     bool operator()(internal_type const & lhs, internal_type const & rhs) const

Modified: branches/release/boost/heap/fibonacci_heap.hpp
==============================================================================
--- branches/release/boost/heap/fibonacci_heap.hpp (original)
+++ branches/release/boost/heap/fibonacci_heap.hpp 2011-12-17 11:51:56 EST (Sat, 17 Dec 2011)
@@ -72,6 +72,14 @@
         {
             base_type::operator=(std::move(static_cast<base_type&>(rhs)));
             allocator_type::operator=(std::move(static_cast<allocator_type&>(rhs)));
+ return *this;
+ }
+
+ type & operator=(type const & rhs)
+ {
+ base_type::operator=(static_cast<base_type const &>(rhs));
+ allocator_type::operator=(static_cast<allocator_type const &>(rhs));
+ return *this;
         }
 #endif
     };
@@ -212,6 +220,7 @@
             return;
 
         clone_forest(rhs);
+ size_holder::set_size(rhs.size());
     }
 
 #ifdef BOOST_HAS_RVALUE_REFS

Modified: branches/release/boost/heap/heap_concepts.hpp
==============================================================================
--- branches/release/boost/heap/heap_concepts.hpp (original)
+++ branches/release/boost/heap/heap_concepts.hpp 2011-12-17 11:51:56 EST (Sat, 17 Dec 2011)
@@ -46,18 +46,20 @@
         v = c.top();
         c.pop();
 
- value_compare cmp = c.value_comp();
+ cmp = c.value_comp();
 
         // verify tags
- bool has_ordered_iterators = C::has_ordered_iterators;
- bool is_mergable = C::is_mergable;
- bool is_stable = C::is_stable;
+ has_ordered_iterators = C::has_ordered_iterators;
+ is_mergable = C::is_mergable;
+ is_stable = C::is_stable;
     }
 
 private:
     C c, c2;
     allocator_type a;
     typename C::value_type v;
+ value_compare cmp;
+ bool has_ordered_iterators, is_mergable, is_stable;
 };
 
 template <class C>

Modified: branches/release/boost/heap/pairing_heap.hpp
==============================================================================
--- branches/release/boost/heap/pairing_heap.hpp (original)
+++ branches/release/boost/heap/pairing_heap.hpp 2011-12-17 11:51:56 EST (Sat, 17 Dec 2011)
@@ -72,6 +72,14 @@
         {
             base_type::operator=(std::move(static_cast<base_type&>(rhs)));
             allocator_type::operator=(std::move(static_cast<allocator_type&>(rhs)));
+ return *this;
+ }
+
+ type & operator=(type const & rhs)
+ {
+ base_type::operator=(static_cast<base_type const &>(rhs));
+ allocator_type::operator=(static_cast<const allocator_type&>(rhs));
+ return *this;
         }
 #endif
     };
@@ -225,6 +233,7 @@
             return;
 
         clone_tree(rhs);
+ size_holder::set_size(rhs.get_size());
     }
 
 #ifdef BOOST_HAS_RVALUE_REFS

Modified: branches/release/boost/heap/policies.hpp
==============================================================================
--- branches/release/boost/heap/policies.hpp (original)
+++ branches/release/boost/heap/policies.hpp 2011-12-17 11:51:56 EST (Sat, 17 Dec 2011)
@@ -13,7 +13,7 @@
 #include <boost/mpl/bool.hpp>
 #include <boost/mpl/int.hpp>
 #include <boost/mpl/void.hpp>
-#include <../boost-trunk/boost/concept_check.hpp>
+#include <boost/concept_check.hpp>
 
 
 namespace boost {

Modified: branches/release/boost/heap/skew_heap.hpp
==============================================================================
--- branches/release/boost/heap/skew_heap.hpp (original)
+++ branches/release/boost/heap/skew_heap.hpp 2011-12-17 11:51:56 EST (Sat, 17 Dec 2011)
@@ -209,6 +209,14 @@
         {
             base_type::operator=(std::move(static_cast<base_type&>(rhs)));
             allocator_type::operator=(std::move(static_cast<allocator_type&>(rhs)));
+ return *this;
+ }
+
+ type & operator=(type const & rhs)
+ {
+ base_type::operator=(static_cast<base_type const &>(rhs));
+ allocator_type::operator=(static_cast<allocator_type const &>(rhs));
+ return *this;
         }
 #endif
     };
@@ -361,6 +369,7 @@
             return;
 
         clone_tree(rhs);
+ size_holder::set_size(rhs.get_size());
     }
 
     /// \copydoc boost::heap::priority_queue::operator=(priority_queue const & rhs)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk