Modify

Ticket #5944 (closed Bugs: fixed)

Opened 3 years ago

Last modified 2 years ago

Compiler error when primitive type for data used

Reported by: bschaeling Owned by: cornedbee
Milestone: Boost 1.48.0 Component: property_tree
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:

Description

This doesn't compile because the primitive type int is used as a second template parameter:

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>:

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.

Attachments

Change History

comment:1 Changed 3 years ago by cornedbee

(In [74691]) 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.

comment:2 Changed 2 years ago by cornedbee

  • Status changed from new to closed
  • Resolution set to fixed

(In [76447]) Merge [72000],[72001],[72003], [74691], [75587], [75589], [75590], and [75593] from trunk. Fixes bug 4840. Fixes bug 5259. Fixes bug 5281, I think. Fixes bug 5944. Fixes bug 5757. Fixes bug 5710. Fixes bug 5307, I think.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.