Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74691 - trunk/boost/property_tree/detail
From: sebastian.redl_at_[hidden]
Date: 2011-10-04 07:11:52


Author: cornedbee
Date: 2011-10-04 07:11:51 EDT (Tue, 04 Oct 2011)
New Revision: 74691
URL: http://svn.boost.org/trac/boost/changeset/74691

Log:
Use boost::swap for swapping PTree's data member. Makes it possible to use types as data that don't provide a member swap(). See bug 5944.
Text files modified:
   trunk/boost/property_tree/detail/ptree_implementation.hpp | 3 ++-
   1 files changed, 2 insertions(+), 1 deletions(-)

Modified: trunk/boost/property_tree/detail/ptree_implementation.hpp
==============================================================================
--- trunk/boost/property_tree/detail/ptree_implementation.hpp (original)
+++ trunk/boost/property_tree/detail/ptree_implementation.hpp 2011-10-04 07:11:51 EDT (Tue, 04 Oct 2011)
@@ -14,6 +14,7 @@
 #include <boost/iterator/iterator_adaptor.hpp>
 #include <boost/iterator/reverse_iterator.hpp>
 #include <boost/assert.hpp>
+#include <boost/utility/swap.hpp>
 #include <memory>
 
 #if defined(BOOST_MSVC) && \
@@ -213,7 +214,7 @@
     template<class K, class D, class C> inline
     void basic_ptree<K, D, C>::swap(basic_ptree<K, D, C> &rhs)
     {
- m_data.swap(rhs.m_data);
+ boost::swap(m_data, rhs.m_data);
         // Void pointers, no ADL necessary
         std::swap(m_children, rhs.m_children);
     }


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