Modify

Opened 6 years ago

Closed 5 years ago

#5944 closed Bugs (fixed)

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 (0)

Change History (2)

comment:1 Changed 6 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 5 years ago by cornedbee

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

(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.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain cornedbee.
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.