[Boost-bugs] [Boost C++ Libraries] #5944: Compiler error when primitive type for data used

Subject: [Boost-bugs] [Boost C++ Libraries] #5944: Compiler error when primitive type for data used
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-09-26 18:33:55


#5944: Compiler error when primitive type for data used
--------------------------+-------------------------------------------------
 Reporter: bschaeling | Owner: cornedbee
     Type: Bugs | Status: new
Milestone: Boost 1.48.0 | Component: property_tree
  Version: Boost 1.47.0 | Severity: Problem
 Keywords: |
--------------------------+-------------------------------------------------
 This doesn't compile because the primitive type ''int'' is used as a
 second template parameter:
 {{{#!c++
 boost::property_tree::basic_ptree<std::string, int> pt, pt2;
 pt.swap(pt2);
 }}}

 The reason is this code in version 1.47.0 of
 <http://svn.boost.org/svn/boost/trunk/boost/property_tree/detail/ptree_implementation.hpp>:
 {{{#!c++
 void basic_ptree<K, D, C>::swap(basic_ptree<K, D, C> &rhs)
 {
   m_data.swap(rhs.m_data);
   // Void pointers, no ADL necessary
   std::swap(m_children, rhs.m_children);
 }
 }}}

 m_data.swap() should be replaced with std::swap() or boost::swap() to make
 it possible to use primitive types for data.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5944>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC