Opened 11 years ago
Closed 11 years ago
#5944 closed Bugs (fixed)
Compiler error when primitive type for data used
Reported by: | bschaeling | Owned by: | Sebastian Redl |
---|---|---|---|
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.
Change History (2)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
(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.