Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76018 - in trunk/boost/heap: . detail
From: tim_at_[hidden]
Date: 2011-12-17 08:20:01


Author: timblechmann
Date: 2011-12-17 08:20:00 EST (Sat, 17 Dec 2011)
New Revision: 76018
URL: http://svn.boost.org/trac/boost/changeset/76018

Log:
heap: c++11 compile fixes

Text files modified:
   trunk/boost/heap/binomial_heap.hpp | 11 ++++++++
   trunk/boost/heap/detail/mutable_heap.hpp | 2
   trunk/boost/heap/detail/stable_heap.hpp | 47 +++++++++++++++++++++++++++++++++++++++
   trunk/boost/heap/fibonacci_heap.hpp | 9 +++++++
   trunk/boost/heap/pairing_heap.hpp | 9 +++++++
   trunk/boost/heap/skew_heap.hpp | 9 +++++++
   6 files changed, 84 insertions(+), 3 deletions(-)

Modified: trunk/boost/heap/binomial_heap.hpp
==============================================================================
--- trunk/boost/heap/binomial_heap.hpp (original)
+++ trunk/boost/heap/binomial_heap.hpp 2011-12-17 08:20:00 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);
 

Modified: trunk/boost/heap/detail/mutable_heap.hpp
==============================================================================
--- trunk/boost/heap/detail/mutable_heap.hpp (original)
+++ trunk/boost/heap/detail/mutable_heap.hpp 2011-12-17 08:20:00 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);

Modified: trunk/boost/heap/detail/stable_heap.hpp
==============================================================================
--- trunk/boost/heap/detail/stable_heap.hpp (original)
+++ trunk/boost/heap/detail/stable_heap.hpp 2011-12-17 08:20:00 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: trunk/boost/heap/fibonacci_heap.hpp
==============================================================================
--- trunk/boost/heap/fibonacci_heap.hpp (original)
+++ trunk/boost/heap/fibonacci_heap.hpp 2011-12-17 08:20:00 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: trunk/boost/heap/pairing_heap.hpp
==============================================================================
--- trunk/boost/heap/pairing_heap.hpp (original)
+++ trunk/boost/heap/pairing_heap.hpp 2011-12-17 08:20:00 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: trunk/boost/heap/skew_heap.hpp
==============================================================================
--- trunk/boost/heap/skew_heap.hpp (original)
+++ trunk/boost/heap/skew_heap.hpp 2011-12-17 08:20:00 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