Subject: [boost] [property_tree] Primitive types for data not supported?
From: Boris Schaeling (boris_at_[hidden])
Date: 2011-09-25 12:18:23


I just noticed that Boost.PropertyTree doesn't support primitive types for
data (Boost 1.47.0). For example, this doesn't compile:

boost::property_tree::basic_ptree<std::string, int> pt, pt2;
pt.swap(pt2);

The reason is this code in
<http://svn.boost.org/svn/boost/trunk/boost/property_tree/detail/ptree_implementation.hpp>:

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);
   // Void pointers, no ADL necessary
   std::swap(m_children, rhs.m_children);
}

Primitive types like int obviously don't have a member function swap(). Is
this an oversight or are primitive types intentionally not supported?

Boris