Ticket #5944 (closed Bugs: fixed)

Opened 6 years ago

Last modified 5 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:


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;

The reason is this code in version 1.47.0 of <>:

void basic_ptree<K, D, C>::swap(basic_ptree<K, D, C> &rhs)
  // 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.


Change History

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

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


Add a comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.