Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
doc/autodoc.xml
doc/html/
10 changes: 10 additions & 0 deletions doc/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,13 @@ boostbook standalone
<dependency>autodoc
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/libs/property_tree/doc/html
;

###############################################################################
alias boostdoc
: property_tree
:
: <dependency>autodoc
: ;
explicit boostdoc ;
alias boostrelease ;
explicit boostrelease ;
46 changes: 46 additions & 0 deletions include/boost/property_tree/detail/ptree_implementation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,15 @@ namespace boost { namespace property_tree
{
}

#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template<class K, class D, class C> inline
basic_ptree<K, D, C>::basic_ptree(basic_ptree<K, D, C> &&rv)
: m_data(std::move(rv.m_data)),
m_children(new typename subs::base_container(std::move(subs::ch(&rv))))
{
}
#endif

template<class K, class D, class C>
basic_ptree<K, D, C> &
basic_ptree<K, D, C>::operator =(const basic_ptree<K, D, C> &rhs)
Expand All @@ -202,6 +211,16 @@ namespace boost { namespace property_tree
return *this;
}

#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template<class K, class D, class C>
basic_ptree<K, D, C> &
basic_ptree<K, D, C>::operator =(basic_ptree<K, D, C> &&rv)
{
rv.swap(*this);
return *this;
}
#endif

template<class K, class D, class C>
basic_ptree<K, D, C>::~basic_ptree()
{
Expand Down Expand Up @@ -329,6 +348,15 @@ namespace boost { namespace property_tree
return iterator(subs::ch(this).insert(where.base(), value).first);
}

#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template<class K, class D, class C> inline
typename basic_ptree<K, D, C>::iterator
basic_ptree<K, D, C>::insert(iterator where, value_type &&value)
{
return iterator(subs::ch(this).insert(where.base(), std::move(value)).first);
}
#endif

template<class K, class D, class C>
template<class It> inline
void basic_ptree<K, D, C>::insert(iterator where, It first, It last)
Expand Down Expand Up @@ -357,13 +385,31 @@ namespace boost { namespace property_tree
return iterator(subs::ch(this).push_front(value).first);
}

#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template<class K, class D, class C> inline
typename basic_ptree<K, D, C>::iterator
basic_ptree<K, D, C>::push_front(value_type &&value)
{
return iterator(subs::ch(this).push_front(std::move(value)).first);
}
#endif

template<class K, class D, class C> inline
typename basic_ptree<K, D, C>::iterator
basic_ptree<K, D, C>::push_back(const value_type &value)
{
return iterator(subs::ch(this).push_back(value).first);
}

#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template<class K, class D, class C> inline
typename basic_ptree<K, D, C>::iterator
basic_ptree<K, D, C>::push_back(value_type &&value)
{
return iterator(subs::ch(this).push_back(std::move(value)).first);
}
#endif

template<class K, class D, class C> inline
void basic_ptree<K, D, C>::pop_front()
{
Expand Down
26 changes: 26 additions & 0 deletions include/boost/property_tree/ptree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,19 @@ namespace boost { namespace property_tree
/** Creates a node with no children and a copy of the given data. */
explicit basic_ptree(const data_type &data);
basic_ptree(const self_type &rhs);

#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
basic_ptree(self_type &&rv);
#endif

~basic_ptree();
/** Basic guarantee only. */
self_type &operator =(const self_type &rhs);

#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
self_type &operator =(self_type &&rv);
#endif

/** Swap with other tree. Only constant-time and nothrow if the
* data type's swap is.
*/
Expand Down Expand Up @@ -126,6 +135,14 @@ namespace boost { namespace property_tree
*/
iterator insert(iterator where, const value_type &value);

#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
/** Insert a copy of the given tree with its key just before the given
* position in this node. This operation invalidates no iterators.
* @return An iterator to the newly created child.
*/
iterator insert(iterator where, value_type &&value);
#endif

/** Range insert. Equivalent to:
* @code
* for(; first != last; ++first) insert(where, *first);
Expand All @@ -150,9 +167,18 @@ namespace boost { namespace property_tree
/** Equivalent to insert(begin(), value). */
iterator push_front(const value_type &value);

#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
/** Equivalent to insert(begin(), value). */
iterator push_front(value_type &&value);
#endif

/** Equivalent to insert(end(), value). */
iterator push_back(const value_type &value);

#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
/** Equivalent to insert(end(), value). */
iterator push_back(value_type &&value);
#endif
/** Equivalent to erase(begin()). */
void pop_front();

Expand Down
1 change: 1 addition & 0 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ test-suite "property_tree"
[ run test_xml_parser_rapidxml.cpp ]

[ run test_multi_module1.cpp test_multi_module2.cpp ]
[ run test_lifecycle.cpp ]
;
Loading