Boost logo

Boost :

Subject: Re: [boost] [property_tree] Primitive types for data not supported?
From: Boris Schaeling (boris_at_[hidden])
Date: 2011-09-26 14:35:29


On Sun, 25 Sep 2011 19:40:01 +0200, Sebastian Redl
<sebastian.redl_at_[hidden]> wrote:

> On 25.09.2011 18:18, Boris Schaeling wrote:
>> 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?
>
> It's an oversight. Can you please file a bug?

Ok, done: <https://svn.boost.org/trac/boost/ticket/5944>

Boris


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk