Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76231 - trunk/boost/heap/detail
From: tim_at_[hidden]
Date: 2011-12-30 08:00:09


Author: timblechmann
Date: 2011-12-30 08:00:09 EST (Fri, 30 Dec 2011)
New Revision: 76231
URL: http://svn.boost.org/trac/boost/changeset/76231

Log:
heap: msvc workaround

Text files modified:
   trunk/boost/heap/detail/mutable_heap.hpp | 10 +++++++---
   1 files changed, 7 insertions(+), 3 deletions(-)

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-30 08:00:09 EST (Fri, 30 Dec 2011)
@@ -149,13 +149,17 @@
 
 #ifdef BOOST_HAS_RVALUE_REFS
     priority_queue_mutable_wrapper (priority_queue_mutable_wrapper && rhs):
- q_(std::move(rhs.q_)), objects(std::move(rhs.objects))
- {}
+ q_(std::move(rhs.q_))
+ {
+ /// FIXME: msvc seems to invalidate iterators when moving std::list
+ std::swap(objects, rhs.objects);
+ }
 
     priority_queue_mutable_wrapper & operator=(priority_queue_mutable_wrapper && rhs)
     {
         q_ = std::move(rhs.q_);
- objects = std::move(rhs.objects);
+ objects.clear();
+ std::swap(objects, rhs.objects);
         return *this;
     }
 #endif


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