
25 Sep
2011
25 Sep
'11
4:18 p.m.
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