Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83404 - in sandbox/tree_node: boost/tree_node libs/tree_node/example libs/tree_node/test
From: sponage_at_[hidden]
Date: 2013-03-11 00:49:18


Author: expaler
Date: 2013-03-11 00:49:15 EDT (Mon, 11 Mar 2013)
New Revision: 83404
URL: http://svn.boost.org/trac/boost/changeset/83404

Log:
Boost.TreeNode: added splice functionality to nary_node.
Added:
   sandbox/tree_node/boost/tree_node/associative_node.hpp (contents, props changed)
   sandbox/tree_node/boost/tree_node/base.hpp (contents, props changed)
   sandbox/tree_node/boost/tree_node/binary_node.hpp (contents, props changed)
   sandbox/tree_node/boost/tree_node/nary_node.hpp (contents, props changed)
   sandbox/tree_node/boost/tree_node/with_accumulation.hpp (contents, props changed)
   sandbox/tree_node/boost/tree_node/with_count.hpp (contents, props changed)
   sandbox/tree_node/boost/tree_node/with_height.hpp (contents, props changed)
   sandbox/tree_node/boost/tree_node/with_position.hpp (contents, props changed)
   sandbox/tree_node/libs/tree_node/example/nary_node.cpp (contents, props changed)
   sandbox/tree_node/libs/tree_node/test/nary_node.cpp (contents, props changed)

Added: sandbox/tree_node/boost/tree_node/associative_node.hpp
==============================================================================
--- (empty file)
+++ sandbox/tree_node/boost/tree_node/associative_node.hpp 2013-03-11 00:49:15 EDT (Mon, 11 Mar 2013)
@@ -0,0 +1,1631 @@
+// Copyright (C) 2011-2013 Cromwell D. Enage
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_TREE_NODE_ASSOCIATIVE_NODE_HPP_INCLUDED
+#define BOOST_TREE_NODE_ASSOCIATIVE_NODE_HPP_INCLUDED
+
+#include <utility>
+#include <boost/mpl/assert.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/iterator/transform_iterator.hpp>
+#include <boost/range/iterator_range.hpp>
+#include <boost/container_gen/container_gen.hpp>
+#include <boost/container_gen/emplace_assoc_function_gen.hpp>
+#include <boost/container_gen/is_associative_selector.hpp>
+#include <boost/container_gen/is_recursive_selector.hpp>
+#include <boost/container_gen/is_ptr_selector.hpp>
+#include <boost/container_gen/has_stable_iters_selector.hpp>
+#include <boost/tree_node/preprocessor.hpp>
+#include <boost/tree_node/base.hpp>
+#include <boost/tree_node/associative_node_fwd.hpp>
+#include <boost/tree_node/intrinsic/has_key.hpp>
+#include <boost/tree_node/intrinsic/get_keys.hpp>
+#include <boost/tree_node/iterator/dereference.hpp>
+#include <boost/detail/metafunction/container_reverse_iterator.hpp>
+#include <boost/assert.hpp>
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/move/move.hpp>
+#endif
+
+#if !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#include <boost/preprocessor/repetition/enum_trailing.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#endif
+
+#include <boost/tree_node/_detail/config_begin.hpp>
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/type_traits/is_pod.hpp>
+
+namespace boost {
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ struct is_POD<
+ ::boost::tree_node::associative_node_base<Derived,Key,Data,Selector>
+ > : ::boost::false_type
+ {
+ };
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ struct is_pod<
+ ::boost::tree_node::associative_node_base<Derived,Key,Data,Selector>
+ > : ::boost::false_type
+ {
+ };
+} // namespace boost
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/mpl/transform_view.hpp>
+#include <boost/fusion/sequence/intrinsic/at_key.hpp>
+#include <boost/fusion/iterator/key_of.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/fusion/support/category_of.hpp>
+
+namespace boost { namespace tree_node { namespace result_of {
+
+ template <
+ typename Derived
+ , typename Key
+ , typename Data
+ , typename Selector
+ , typename FusionKey
+ >
+ struct has_key_impl<
+ associative_node_base<Derived,Key,Data,Selector>
+ , FusionKey
+ > : ::boost::mpl::eval_if<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<Data>::type
+ , ::boost::fusion::traits::is_associative<Data>
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::has_key<Data,FusionKey>
+ , ::std::tr1::is_same<FusionKey,data_key>
+ >::type
+ {
+ };
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ struct get_keys_impl<
+ associative_node_base<Derived,Key,Data,Selector>
+ > : ::boost::mpl::eval_if<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<Data>::type
+ , ::boost::fusion::traits::is_associative<Data>
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::mpl::transform_view<
+ Data
+ , ::boost::fusion::result_of::key_of< ::boost::mpl::_>
+ >
+ , ::boost::mpl::vector1<data_key>
+ >
+ {
+ };
+}}} // namespace boost::tree_node::result_of
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+
+namespace boost { namespace tree_node {
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ class associative_node_base
+ : public
+ //[reference__associative_node_base__bases
+ tree_node_base<Derived>
+ //]
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ , public data_key
+#endif
+ , private ::boost::noncopyable
+ {
+ BOOST_MPL_ASSERT((::boost::is_associative_selector<Selector>));
+ BOOST_MPL_ASSERT((::boost::is_recursive_selector<Selector>));
+
+ //[reference__associative_node_base__children
+ typedef typename ::boost::container_gen<Selector,Key,Derived>::type
+ children;
+ //]
+
+ public:
+ //[reference__associative_node_base__super_t
+ typedef tree_node_base<Derived>
+ super_t;
+ //]
+
+ //[reference__associative_node_base__pointer
+ typedef typename super_t::pointer
+ pointer;
+ //]
+
+ //[reference__associative_node_base__const_pointer
+ typedef typename super_t::const_pointer
+ const_pointer;
+ //]
+
+ //[reference__associative_node_base__iterator
+ typedef typename children::iterator
+ iterator;
+ //]
+
+ //[reference__associative_node_base__const_iterator
+ typedef typename children::const_iterator
+ const_iterator;
+ //]
+
+ //[reference__associative_node_base__reverse_iterator
+ typedef // typename children::reverse_iterator
+ //<-
+ typename ::boost::detail::metafunction
+ ::container_reverse_iterator<children>::type
+ //->
+ reverse_iterator;
+ //]
+
+ //[reference__associative_node_base__const_reverse_iterator
+ typedef // typename children::const_reverse_iterator
+ //<-
+ typename ::boost::detail::metafunction
+ ::container_reverse_iterator<children const>::type
+ //->
+ const_reverse_iterator;
+ //]
+
+ //[reference__associative_node_base__size_type
+ typedef typename children::size_type
+ size_type;
+ //]
+
+ //[reference__associative_node_base__traits
+ struct traits
+ {
+ typedef Key
+ key_type;
+ typedef Data
+ data_type;
+ typedef typename ::boost::mpl::if_<
+ ::boost::is_ptr_selector<Selector>
+ , ::boost::iterator_range<iterator>
+ , ::std::pair<iterator,iterator>
+ >::type
+ iterator_range;
+ typedef typename ::boost::mpl::if_<
+ ::boost::is_ptr_selector<Selector>
+ , ::boost::iterator_range<const_iterator>
+ , ::std::pair<const_iterator,const_iterator>
+ >::type
+ const_iterator_range;
+ typedef typename children::allocator_type
+ allocator;
+ typedef allocator const&
+ allocator_reference;
+ };
+ //]
+
+ private:
+ children _children;
+ typename traits::data_type _data;
+ pointer _parent;
+
+ protected:
+ //[reference__associative_node_base__derived_copy_ctor
+ associative_node_base(Derived const& copy);
+ //]
+
+ //[reference__associative_node_base__derived_copy_ctor_w_allocator
+ associative_node_base(
+ Derived const& copy
+ , typename traits::allocator_reference allocator
+ );
+ //]
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ associative_node_base(BOOST_RV_REF(Derived) source);
+
+ associative_node_base(
+ BOOST_RV_REF(Derived) source
+ , typename traits::allocator_reference allocator
+ );
+#endif
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ //[reference__associative_node_base__emplacement_ctor
+ template <typename ...Args>
+ explicit associative_node_base(Args&& ...args);
+ //]
+
+ //[reference__associative_node_base__emplacement_ctor_w_allocator
+ template <typename ...Args>
+ explicit associative_node_base(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ );
+ //]
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_FWD_DECL
+ , associative_node_base
+ )
+
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_W_ALLOC_FWD_DECL
+ , associative_node_base
+ )
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ ~associative_node_base();
+
+ //[reference__associative_node_base__on_post_copy_or_move
+ void on_post_copy_or_move();
+ //]
+
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ //[reference__associative_node_base__copy_assign
+ void copy_assign(Derived const& copy);
+ //]
+#else
+ void copy_assign(BOOST_COPY_ASSIGN_REF(Derived) copy);
+
+ void move_assign(BOOST_RV_REF(Derived) source);
+#endif
+
+ public:
+ //[reference__associative_node_base__data_key_value_operator__const
+ typename traits::data_type const& operator[](data_key const&) const;
+ //]
+
+ //[reference__associative_node_base__data_key_value_operator
+ typename traits::data_type& operator[](data_key const&);
+ //]
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ //[reference__associative_node_base__key_value_operator__const
+ template <typename FusionKey>
+ typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<Data>::type
+ , ::boost::fusion::traits::is_associative<Data>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ associative_node_base<Derived,Key,Data,Selector>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<Data const,FusionKey>
+ >::type
+ operator[](FusionKey const&) const;
+ //]
+
+ //[reference__associative_node_base__key_value_operator
+ template <typename FusionKey>
+ typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<Data>::type
+ , ::boost::fusion::traits::is_associative<Data>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ associative_node_base<Derived,Key,Data,Selector>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<Data,FusionKey>
+ >::type
+ operator[](FusionKey const&);
+ //]
+#endif
+
+ //[reference__associative_node_base__get_parent_ptr__const
+ const_pointer get_parent_ptr() const;
+ //]
+
+ //[reference__associative_node_base__get_parent_ptr
+ pointer get_parent_ptr();
+ //]
+
+ //[reference__associative_node_base__insert
+ iterator
+ insert(
+ typename traits::key_type const& key
+ , Derived const& child
+ );
+ //]
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ //[reference__associative_node_base__emplace
+ template <typename ...Args>
+ iterator emplace(typename traits::key_type const& key, Args&& ...args);
+ //]
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#define BOOST_TREE_NODE_ASSOCIATIVE_NODE_MACRO(z, n, _) \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ iterator \
+ emplace( \
+ typename traits::key_type const& key \
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ); \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_ASSOCIATIVE_NODE_MACRO
+ , _
+ )
+#undef BOOST_TREE_NODE_ASSOCIATIVE_NODE_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ //[reference__associative_node_base__cbegin
+ const_iterator cbegin() const;
+ const_iterator begin() const;
+ //]
+
+ //[reference__associative_node_base__begin
+ iterator begin();
+ //]
+
+ //[reference__associative_node_base__cend
+ const_iterator cend() const;
+ const_iterator end() const;
+ //]
+
+ //[reference__associative_node_base__end
+ iterator end();
+ //]
+
+ //[reference__associative_node_base__crbegin
+ const_reverse_iterator crbegin() const;
+ const_reverse_iterator rbegin() const;
+ //]
+
+ //[reference__associative_node_base__rbegin
+ reverse_iterator rbegin();
+ //]
+
+ //[reference__associative_node_base__crend
+ const_reverse_iterator crend() const;
+ const_reverse_iterator rend() const;
+ //]
+
+ //[reference__associative_node_base__rend
+ reverse_iterator rend();
+ //]
+
+ //[reference__associative_node_base__size
+ size_type size() const;
+ //]
+
+ //[reference__associative_node_base__empty
+ bool empty() const;
+ //]
+
+ //[reference__associative_node_base__clear
+ void clear();
+ //]
+
+ //[reference__associative_node_base__find__const
+ const_iterator find(typename traits::key_type const& key) const;
+ //]
+
+ //[reference__associative_node_base__find
+ iterator find(typename traits::key_type const& key);
+ //]
+
+ //[reference__associative_node_base__equal_range__const
+ typename traits::const_iterator_range
+ equal_range(typename traits::key_type const& key) const;
+ //]
+
+ //[reference__associative_node_base__equal_range
+ typename traits::iterator_range
+ equal_range(typename traits::key_type const& key);
+ //]
+
+ //[reference__associative_node_base__erase
+ size_type erase(typename traits::key_type const& key);
+ //]
+
+ private:
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <typename ...Args>
+ iterator
+ _add_child(typename traits::key_type const& key, Args&& ...args);
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#define BOOST_TREE_NODE_ASSOCIATIVE_NODE_MACRO(z, n, _) \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ iterator \
+ _add_child( \
+ typename traits::key_type const& key \
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ); \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_ASSOCIATIVE_NODE_MACRO
+ , _
+ )
+#undef BOOST_TREE_NODE_ASSOCIATIVE_NODE_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ void _initialize(iterator& itr);
+
+ void _link_children_to_parent();
+
+ void _on_post_modify_value(data_key const& key);
+
+ template <typename D, typename K, typename T, typename S, typename V>
+ friend void
+ put(
+ associative_node_base<D,K,T,S>& node
+ , data_key const& key
+ , V const& value
+ );
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ template <typename FusionKey>
+ void _on_post_modify_value(FusionKey const& key);
+
+ template <
+ typename D
+ , typename K
+ , typename T
+ , typename S
+ , typename FusionKey
+ , typename V
+ >
+ friend void
+ put(
+ associative_node_base<D,K,T,S>& node
+ , FusionKey const& key
+ , V const& value
+ , typename ::boost::enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<associative_node_base<D,K,T,S>,FusionKey>
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::mpl::true_
+ >::type
+ );
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+ };
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ associative_node_base<Derived,Key,Data,Selector>::associative_node_base(
+ Derived const& copy
+ ) : _children(copy._children)
+ , _data(copy._data)
+ , _parent(copy._parent)
+ {
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ associative_node_base<Derived,Key,Data,Selector>::associative_node_base(
+ Derived const& copy
+ , typename traits::allocator_reference allocator
+ ) : _children(copy._children, allocator)
+ , _data(copy._data)
+ , _parent(copy._parent)
+ {
+ }
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ associative_node_base<Derived,Key,Data,Selector>::associative_node_base(
+ BOOST_RV_REF(Derived) source
+ ) : _children(::boost::move(source._children))
+ , _data(::boost::move(source._data))
+ , _parent(source._parent)
+ {
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ associative_node_base<Derived,Key,Data,Selector>::associative_node_base(
+ BOOST_RV_REF(Derived) source
+ , typename traits::allocator_reference allocator
+ ) : _children(::boost::move(source._children), allocator)
+ , _data(::boost::move(source._data))
+ , _parent(source._parent)
+ {
+ }
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ template <typename ...Args>
+ associative_node_base<Derived,Key,Data,Selector>::associative_node_base(
+ Args&& ...args
+ ) : _children(), _data(::boost::forward<Args>(args)...), _parent()
+ {
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ template <typename ...Args>
+ associative_node_base<Derived,Key,Data,Selector>::associative_node_base(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ ) : _children(allocator), _data(::boost::forward<Args>(args)...), _parent()
+ {
+ }
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#define BOOST_TREE_NODE_ASSOCIATIVE_NODE_MACRO(z, n, _) \
+ template < \
+ typename Derived \
+ , typename Key \
+ , typename Data \
+ , typename Selector \
+ > \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ associative_node_base<Derived,Key,Data,Selector>::associative_node_base( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ) : _children() \
+ , _data( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_FORWARD \
+ , _ \
+ ) \
+ ) \
+ , _parent() \
+ { \
+ } \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_ASSOCIATIVE_NODE_MACRO
+ , _
+ )
+#undef BOOST_TREE_NODE_ASSOCIATIVE_NODE_MACRO
+
+#define BOOST_TREE_NODE_ASSOCIATIVE_NODE_MACRO(z, n, _) \
+ template < \
+ typename Derived \
+ , typename Key \
+ , typename Data \
+ , typename Selector \
+ > \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ associative_node_base<Derived,Key,Data,Selector>::associative_node_base( \
+ ::boost::container::allocator_arg_t \
+ , typename traits::allocator_reference allocator \
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ) : _children(allocator) \
+ , _data( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_FORWARD \
+ , _ \
+ ) \
+ ) \
+ , _parent() \
+ { \
+ } \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_ASSOCIATIVE_NODE_MACRO
+ , _
+ )
+#undef BOOST_TREE_NODE_ASSOCIATIVE_NODE_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ associative_node_base<Derived,Key,Data,Selector>::~associative_node_base()
+ {
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline void
+ associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::on_post_copy_or_move()
+ {
+ this->_link_children_to_parent();
+ this->on_post_propagate_value(data_key());
+ }
+
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ void
+ associative_node_base<Derived,Key,Data,Selector>::copy_assign(
+ Derived const& copy
+ )
+ {
+ Derived twin(copy);
+
+ this->_children = twin._children;
+ this->_data = twin._data;
+ }
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ void
+ associative_node_base<Derived,Key,Data,Selector>::copy_assign(
+ BOOST_COPY_ASSIGN_REF(Derived) copy
+ )
+ {
+ Derived twin(static_cast<Derived const&>(copy));
+
+ this->_children = ::boost::move(twin._children);
+ this->_data = ::boost::move(twin._data);
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline void
+ associative_node_base<Derived,Key,Data,Selector>::move_assign(
+ BOOST_RV_REF(Derived) source
+ )
+ {
+ this->_children = ::boost::move(source._children);
+ this->_data = ::boost::move(source._data);
+ }
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::traits::data_type const&
+ associative_node_base<Derived,Key,Data,Selector>::operator[](
+ data_key const&
+ ) const
+ {
+ return this->_data;
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::traits::data_type&
+ associative_node_base<Derived,Key,Data,Selector>::operator[](
+ data_key const&
+ )
+ {
+ return this->_data;
+ }
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ template <typename FusionKey>
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<Data>::type
+ , ::boost::fusion::traits::is_associative<Data>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ associative_node_base<Derived,Key,Data,Selector>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<Data const,FusionKey>
+ >::type
+ associative_node_base<Derived,Key,Data,Selector>::operator[](
+ FusionKey const&
+ ) const
+ {
+ return ::boost::fusion::at_key<FusionKey>(this->_data);
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ template <typename FusionKey>
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<Data>::type
+ , ::boost::fusion::traits::is_associative<Data>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ associative_node_base<Derived,Key,Data,Selector>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<Data,FusionKey>
+ >::type
+ associative_node_base<Derived,Key,Data,Selector>::operator[](
+ FusionKey const&
+ )
+ {
+ return ::boost::fusion::at_key<FusionKey>(this->_data);
+ }
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::const_pointer
+ associative_node_base<Derived,Key,Data,Selector>::get_parent_ptr() const
+ {
+ return this->_parent;
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<Derived,Key,Data,Selector>::pointer
+ associative_node_base<Derived,Key,Data,Selector>::get_parent_ptr()
+ {
+ return this->_parent;
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<Derived,Key,Data,Selector>::iterator
+ associative_node_base<Derived,Key,Data,Selector>::insert(
+ typename traits::key_type const& key
+ , Derived const& child
+ )
+ {
+#if defined BOOST_MSVC
+ Derived twin(child);
+ iterator result(this->_add_child(key, twin));
+#else
+ iterator result(this->_add_child(key, Derived(child)));
+#endif
+ BOOST_ASSERT(
+ dereference_iterator(result)._parent == this->get_derived()
+ );
+ return result;
+ }
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ template <typename ...Args>
+ typename associative_node_base<Derived,Key,Data,Selector>::iterator
+ associative_node_base<Derived,Key,Data,Selector>::emplace(
+ typename traits::key_type const& key
+ , Args&& ...args
+ )
+ {
+ iterator result(
+ this->_add_child(key, ::boost::forward<Args>(args)...)
+ );
+ BOOST_ASSERT(
+ dereference_iterator(result)._parent == this->get_derived()
+ );
+ return result;
+ }
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#define BOOST_TREE_NODE_ASSOCIATIVE_NODE_MACRO(z, n, _) \
+ template < \
+ typename Derived \
+ , typename Key \
+ , typename Data \
+ , typename Selector \
+ > \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ typename associative_node_base<Derived,Key,Data,Selector>::iterator \
+ associative_node_base<Derived,Key,Data,Selector>::emplace( \
+ typename traits::key_type const& key \
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ) \
+ { \
+ iterator result = this->_add_child( \
+ key \
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_FORWARD \
+ , _ \
+ ) \
+ ); \
+ BOOST_ASSERT( \
+ dereference_iterator(result)._parent == this->get_derived() \
+ ); \
+ return result; \
+ } \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_ASSOCIATIVE_NODE_MACRO
+ , _
+ )
+#undef BOOST_TREE_NODE_ASSOCIATIVE_NODE_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::const_iterator
+ associative_node_base<Derived,Key,Data,Selector>::cbegin() const
+ {
+ return this->_children.cbegin();
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::const_iterator
+ associative_node_base<Derived,Key,Data,Selector>::begin() const
+ {
+ return this->_children.begin();
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<Derived,Key,Data,Selector>::iterator
+ associative_node_base<Derived,Key,Data,Selector>::begin()
+ {
+ return this->_children.begin();
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::const_iterator
+ associative_node_base<Derived,Key,Data,Selector>::cend() const
+ {
+ return this->_children.cend();
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::const_iterator
+ associative_node_base<Derived,Key,Data,Selector>::end() const
+ {
+ return this->_children.end();
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<Derived,Key,Data,Selector>::iterator
+ associative_node_base<Derived,Key,Data,Selector>::end()
+ {
+ return this->_children.end();
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::const_reverse_iterator
+ associative_node_base<Derived,Key,Data,Selector>::crbegin() const
+ {
+ return this->_children.crbegin();
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::const_reverse_iterator
+ associative_node_base<Derived,Key,Data,Selector>::rbegin() const
+ {
+ return this->_children.rbegin();
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::reverse_iterator
+ associative_node_base<Derived,Key,Data,Selector>::rbegin()
+ {
+ return this->_children.rbegin();
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::const_reverse_iterator
+ associative_node_base<Derived,Key,Data,Selector>::crend() const
+ {
+ return this->_children.crend();
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::const_reverse_iterator
+ associative_node_base<Derived,Key,Data,Selector>::rend() const
+ {
+ return this->_children.rend();
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::reverse_iterator
+ associative_node_base<Derived,Key,Data,Selector>::rend()
+ {
+ return this->_children.rend();
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<Derived,Key,Data,Selector>::size_type
+ associative_node_base<Derived,Key,Data,Selector>::size() const
+ {
+ return this->_children.size();
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline bool associative_node_base<Derived,Key,Data,Selector>::empty() const
+ {
+ return this->_children.empty();
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline void associative_node_base<Derived,Key,Data,Selector>::clear()
+ {
+ this->_children.clear();
+ this->on_post_clear();
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::const_iterator
+ associative_node_base<Derived,Key,Data,Selector>::find(
+ typename traits::key_type const& key
+ ) const
+ {
+ return this->_children.find(key);
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<Derived,Key,Data,Selector>::iterator
+ associative_node_base<Derived,Key,Data,Selector>::find(
+ typename traits::key_type const& key
+ )
+ {
+ return this->_children.find(key);
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::traits::const_iterator_range
+ associative_node_base<Derived,Key,Data,Selector>::equal_range(
+ typename traits::key_type const& key
+ ) const
+ {
+ return this->_children.equal_range(key);
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::traits::iterator_range
+ associative_node_base<Derived,Key,Data,Selector>::equal_range(
+ typename traits::key_type const& key
+ )
+ {
+ return this->_children.equal_range(key);
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ typename associative_node_base<Derived,Key,Data,Selector>::size_type
+ associative_node_base<Derived,Key,Data,Selector>::erase(
+ typename traits::key_type const& key
+ )
+ {
+ size_type result = this->_children.erase(key);
+ this->on_post_erase();
+ return result;
+ }
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ template <typename ...Args>
+ typename associative_node_base<Derived,Key,Data,Selector>::iterator
+ associative_node_base<Derived,Key,Data,Selector>::_add_child(
+ typename traits::key_type const& key
+ , Args&& ...args
+ )
+ {
+ typename ::boost::emplace_associative_function_gen<Selector>::type
+ emplacer;
+ ::std::pair<iterator,bool> p = emplacer(
+ this->_children
+ , key
+ , ::boost::forward<Args>(args)...
+ );
+
+ if (p.second)
+ {
+ this->_initialize(p.first);
+ }
+
+ return p.first;
+ }
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#define BOOST_TREE_NODE_ASSOCIATIVE_NODE_MACRO(z, n, _) \
+ template < \
+ typename Derived \
+ , typename Key \
+ , typename Data \
+ , typename Selector \
+ > \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ typename associative_node_base<Derived,Key,Data,Selector>::iterator \
+ associative_node_base<Derived,Key,Data,Selector>::_add_child( \
+ typename traits::key_type const& key \
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ) \
+ { \
+ typename ::boost::emplace_associative_function_gen<Selector>::type \
+ emplacer; \
+ ::std::pair<iterator,bool> p = emplacer( \
+ this->_children \
+ , key \
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_FORWARD \
+ , _ \
+ ) \
+ ); \
+ if (p.second) \
+ { \
+ this->_initialize(p.first); \
+ } \
+ return p.first; \
+ } \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_ASSOCIATIVE_NODE_MACRO
+ , _
+ )
+#undef BOOST_TREE_NODE_ASSOCIATIVE_NODE_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline void
+ associative_node_base<Derived,Key,Data,Selector>::_initialize(
+ iterator& itr
+ )
+ {
+ Derived& child = dereference_iterator(itr);
+
+ child._parent = this->get_derived();
+ child.on_post_inserted(
+ itr
+ , ::boost::has_stable_iterators_selector<Selector>()
+ );
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ void
+ associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::_link_children_to_parent()
+ {
+ iterator itr_end = this->end();
+
+ for (iterator itr = this->begin(); itr != itr_end; ++itr)
+ {
+ dereference_iterator(itr)._parent = this->get_derived();
+ }
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline void
+ associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::_on_post_modify_value(data_key const& key)
+ {
+ this->on_post_propagate_value(key);
+ }
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ template <typename FusionKey>
+ inline void
+ associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::_on_post_modify_value(FusionKey const& key)
+ {
+ this->on_post_propagate_value(key);
+ }
+#endif
+}} // namespace boost::tree_node
+
+namespace boost { namespace tree_node {
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::traits::data_type const&
+ get(
+ associative_node_base<Derived,Key,Data,Selector> const& node
+ , data_key const& key
+ )
+ {
+ return node[key];
+ }
+
+ template <typename Derived, typename Key, typename Data, typename Selector>
+ inline typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::traits::data_type&
+ get(
+ associative_node_base<Derived,Key,Data,Selector>& node
+ , data_key const& key
+ )
+ {
+ return node[key];
+ }
+
+#if !defined BOOST_NO_SFINAE
+ template <
+ typename DataKey
+ , typename Derived
+ , typename Key
+ , typename Data
+ , typename Selector
+ >
+ inline typename ::boost::enable_if<
+ ::std::tr1::is_same<DataKey,data_key>
+ , typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::traits::data_type const&
+ >::type
+ get(associative_node_base<Derived,Key,Data,Selector> const& node)
+ {
+ return node[data_key()];
+ }
+
+ template <
+ typename DataKey
+ , typename Derived
+ , typename Key
+ , typename Data
+ , typename Selector
+ >
+ inline typename ::boost::enable_if<
+ ::std::tr1::is_same<DataKey,data_key>
+ , typename associative_node_base<
+ Derived
+ , Key
+ , Data
+ , Selector
+ >::traits::data_type&
+ >::type
+ get(associative_node_base<Derived,Key,Data,Selector>& node)
+ {
+ return node[data_key()];
+ }
+#endif // BOOST_NO_SFINAE
+
+ template <
+ typename Derived
+ , typename Key
+ , typename Data
+ , typename Selector
+ , typename V
+ >
+ inline void
+ put(
+ associative_node_base<Derived,Key,Data,Selector>& node
+ , data_key const& key
+ , V const& value
+ )
+ {
+ node[key] = value;
+ node._on_post_modify_value(key);
+ }
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ template <
+ typename Derived
+ , typename Key
+ , typename Data
+ , typename Selector
+ , typename FusionKey
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<Data>::type
+ , ::boost::fusion::traits::is_associative<Data>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ associative_node_base<Derived,Key,Data,Selector>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<Data const,FusionKey>
+ >::type
+ get(
+ associative_node_base<Derived,Key,Data,Selector> const& node
+ , FusionKey const& key
+ )
+ {
+ return node[key];
+ }
+
+ template <
+ typename Derived
+ , typename Key
+ , typename Data
+ , typename Selector
+ , typename FusionKey
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<Data>::type
+ , ::boost::fusion::traits::is_associative<Data>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ associative_node_base<Derived,Key,Data,Selector>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<Data,FusionKey>
+ >::type
+ get(
+ associative_node_base<Derived,Key,Data,Selector>& node
+ , FusionKey const& key
+ )
+ {
+ return node[key];
+ }
+
+ template <
+ typename FusionKey
+ , typename Derived
+ , typename Key
+ , typename Data
+ , typename Selector
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<Data>::type
+ , ::boost::fusion::traits::is_associative<Data>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ associative_node_base<Derived,Key,Data,Selector>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<Data const,FusionKey>
+ >::type
+ get(associative_node_base<Derived,Key,Data,Selector> const& node)
+ {
+ return node[FusionKey()];
+ }
+
+ template <
+ typename FusionKey
+ , typename Derived
+ , typename Key
+ , typename Data
+ , typename Selector
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<Data>::type
+ , ::boost::fusion::traits::is_associative<Data>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ associative_node_base<Derived,Key,Data,Selector>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<Data,FusionKey>
+ >::type
+ get(associative_node_base<Derived,Key,Data,Selector>& node)
+ {
+ return node[FusionKey()];
+ }
+
+ template <
+ typename Derived
+ , typename Key
+ , typename Data
+ , typename Selector
+ , typename FusionKey
+ , typename V
+ >
+ inline void
+ put(
+ associative_node_base<Derived,Key,Data,Selector>& node
+ , FusionKey const& key
+ , V const& value
+ , typename ::boost::enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<Data>::type
+ , ::boost::fusion::traits::is_associative<Data>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ associative_node_base<Derived,Key,Data,Selector>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::mpl::true_
+ >::type
+ )
+ {
+ node[key] = value;
+ node._on_post_modify_value(key);
+ }
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+}} // namespace boost::tree_node
+
+//[reference__associative_node_base_gen
+namespace boost { namespace tree_node {
+
+ template <typename Selector = ::boost::ptr_mapS>
+ struct associative_node_base_gen
+ {
+ template <typename Derived, typename Key, typename Data>
+ struct apply
+ {
+ typedef associative_node_base<Derived,Key,Data,Selector> type;
+ };
+ };
+
+ typedef associative_node_base_gen<> associative_node_base_default_gen;
+}} // namespace boost::tree_node
+//]
+
+namespace boost { namespace tree_node {
+
+ template <typename Key, typename Data, typename Selector>
+ struct associative_node
+ : public
+ //[reference__associative_node__bases
+ associative_node_base<
+ associative_node<Key,Data,Selector>
+ , Key
+ , Data
+ , Selector
+ >
+ //]
+ {
+ //[reference__associative_node__super_t
+ typedef associative_node_base<
+ associative_node
+ , Key
+ , Data
+ , Selector
+ >
+ super_t;
+ //]
+
+ //[reference__associative_node__traits
+ typedef typename super_t::traits
+ traits;
+ //]
+
+ //[reference__associative_node__pointer
+ typedef typename super_t::pointer
+ pointer;
+ //]
+
+ //[reference__associative_node__const_pointer
+ typedef typename super_t::const_pointer
+ const_pointer;
+ //]
+
+ //[reference__associative_node__iterator
+ typedef typename super_t::iterator
+ iterator;
+ //]
+
+ //[reference__associative_node__const_iterator
+ typedef typename super_t::const_iterator
+ const_iterator;
+ //]
+
+ //[reference__associative_node__reverse_iterator
+ typedef typename super_t::reverse_iterator
+ reverse_iterator;
+ //]
+
+ //[reference__associative_node__const_reverse_iterator
+ typedef typename super_t::const_reverse_iterator
+ const_reverse_iterator;
+ //]
+
+ //[reference__associative_node__size_type
+ typedef typename super_t::size_type
+ size_type;
+ //]
+
+ BOOST_TREE_NODE_COPYABLE_AND_MOVABLE(associative_node, super_t)
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ //[reference__associative_node__emplacement_ctor
+ template <typename ...Args>
+ explicit associative_node(Args&& ...args);
+ //]
+
+ //[reference__associative_node__emplacement_ctor_w_allocator
+ template <typename ...Args>
+ explicit associative_node(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ );
+ //]
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_INLINE_DEF
+ , (associative_node, super_t)
+ )
+
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_W_ALLOC_INLINE_DEF
+ , (associative_node, super_t)
+ )
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+ };
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <typename Key, typename Data, typename Selector>
+ template <typename ...Args>
+ inline associative_node<Key,Data,Selector>::associative_node(
+ Args&& ...args
+ ) : super_t(::boost::forward<Args>(args)...)
+ {
+ }
+
+ template <typename Key, typename Data, typename Selector>
+ template <typename ...Args>
+ inline associative_node<Key,Data,Selector>::associative_node(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ ) : super_t(
+ ::boost::container::allocator_arg
+ , allocator
+ , ::boost::forward<Args>(args)...
+ )
+ {
+ }
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+}} // namespace boost::tree_node
+
+//[reference__associative_node_gen
+namespace boost { namespace tree_node {
+
+ template <typename Selector = ::boost::ptr_mapS>
+ struct associative_node_gen
+ {
+ template <typename Key, typename Data>
+ struct apply
+ {
+ typedef associative_node<Key,Data,Selector> type;
+ };
+ };
+
+ typedef associative_node_gen<> associative_node_default_gen;
+}} // namespace boost::tree_node
+//]
+
+#include <boost/tree_node/_detail/config_end.hpp>
+
+#endif // BOOST_TREE_NODE_ASSOCIATIVE_NODE_HPP_INCLUDED
+

Added: sandbox/tree_node/boost/tree_node/base.hpp
==============================================================================
--- (empty file)
+++ sandbox/tree_node/boost/tree_node/base.hpp 2013-03-11 00:49:15 EDT (Mon, 11 Mar 2013)
@@ -0,0 +1,315 @@
+// Copyright (C) 2011-2013 Cromwell D. Enage
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_TREE_NODE_BASE_HPP_INCLUDED
+#define BOOST_TREE_NODE_BASE_HPP_INCLUDED
+
+#include <boost/mpl/bool.hpp>
+#include <boost/detail/base_pointee.hpp>
+
+namespace boost { namespace tree_node {
+
+ template <typename Derived>
+ struct tree_node_base
+ : public ::boost::detail::base_pointee<Derived>
+ {
+ typedef typename ::boost::detail::base_pointee<Derived>::pointer
+ pointer;
+ typedef typename ::boost::detail::base_pointee<Derived>::const_pointer
+ const_pointer;
+ typedef void
+ super_t;
+
+ protected:
+ ~tree_node_base();
+
+ //[reference__tree_node_base__on_post_emplacement_construct
+ void on_post_emplacement_construct();
+ //]
+
+ //[reference__tree_node_base__on_post_modify_value_impl
+ template <typename Key>
+ void on_post_modify_value_impl(Key const& key);
+ //]
+
+ //[reference__tree_node_base__on_post_modify_value
+ template <typename Key>
+ void on_post_modify_value(Key const& key);
+ //]
+
+ //[reference__tree_node_base__on_post_propagate_value_impl
+ template <typename Key>
+ void on_post_propagate_value_impl(Key const& key);
+ //]
+
+ //[reference__tree_node_base__on_post_propagate_value
+ template <typename Key>
+ void on_post_propagate_value(Key const& key);
+ //]
+
+ //[reference__tree_node_base__on_post_propagate_value_once_impl
+ template <typename Key>
+ void on_post_propagate_value_once_impl(Key const& key);
+ //]
+
+ //[reference__tree_node_base__on_post_propagate_value_once
+ template <typename Key>
+ void on_post_propagate_value_once(Key const& key);
+ //]
+
+ //[reference__tree_node_base__on_post_inserted_impl__true
+ template <typename Iterator>
+ void on_post_inserted_impl(Iterator position, ::boost::mpl::true_);
+ //]
+
+ //[reference__tree_node_base__on_post_inserted_impl__false
+ template <typename Iterator>
+ void on_post_inserted_impl(Iterator position, ::boost::mpl::false_);
+ //]
+
+ //[reference__tree_node_base__on_post_inserted
+ template <typename Iterator, typename BooleanIntegralConstant>
+ void
+ on_post_inserted(
+ Iterator position
+ , BooleanIntegralConstant invalidates_sibling_positions
+ );
+ //]
+
+ //[reference__tree_node_base__on_post_insert_impl__true
+ template <typename Iterator>
+ void
+ on_post_insert_impl(
+ Iterator itr
+ , Iterator itr_end
+ , ::boost::mpl::true_
+ );
+ //]
+
+ //[reference__tree_node_base__on_post_insert_impl__false
+ template <typename Iterator>
+ void
+ on_post_insert_impl(
+ Iterator itr
+ , Iterator itr_end
+ , ::boost::mpl::false_
+ );
+ //]
+
+ //[reference__tree_node_base__on_post_insert
+ template <typename Iterator, typename BooleanIntegralConstant>
+ void
+ on_post_insert(
+ Iterator itr
+ , Iterator itr_end
+ , BooleanIntegralConstant invalidates_children_positions
+ );
+ //]
+
+ //[reference__tree_node_base__on_post_erase_impl
+ void on_post_erase_impl();
+ //]
+
+ //[reference__tree_node_base__on_post_erase
+ void on_post_erase();
+ //]
+
+ //[reference__tree_node_base__on_post_clear_impl
+ void on_post_clear_impl();
+ //]
+
+ //[reference__tree_node_base__on_post_clear
+ void on_post_clear();
+ //]
+
+ //[reference__tree_node_base__on_post_rotate_left_impl
+ void on_post_rotate_left_impl();
+ //]
+
+ //[reference__tree_node_base__on_post_rotate_left
+ void on_post_rotate_left();
+ //]
+
+ //[reference__tree_node_base__on_post_rotate_right_impl
+ void on_post_rotate_right_impl();
+ //]
+
+ //[reference__tree_node_base__on_post_rotate_right
+ void on_post_rotate_right();
+ //]
+ };
+
+ template <typename Derived>
+ tree_node_base<Derived>::~tree_node_base()
+ {
+ }
+
+ template <typename Derived>
+ inline void tree_node_base<Derived>::on_post_emplacement_construct()
+ {
+ }
+
+ template <typename Derived>
+ template <typename Key>
+ inline void tree_node_base<Derived>::on_post_modify_value_impl(Key const&)
+ {
+ }
+
+ template <typename Derived>
+ template <typename Key>
+ inline void tree_node_base<Derived>::on_post_modify_value(Key const& key)
+ {
+ this->get_derived()->on_post_modify_value_impl(key);
+ }
+
+ template <typename Derived>
+ template <typename Key>
+ inline void
+ tree_node_base<Derived>::on_post_propagate_value_impl(Key const&)
+ {
+ }
+
+ template <typename Derived>
+ template <typename Key>
+ inline void
+ tree_node_base<Derived>::on_post_propagate_value(Key const& key)
+ {
+ this->get_derived()->on_post_propagate_value_impl(key);
+ }
+
+ template <typename Derived>
+ template <typename Key>
+ inline void
+ tree_node_base<Derived>::on_post_propagate_value_once_impl(Key const&)
+ {
+ }
+
+ template <typename Derived>
+ template <typename Key>
+ inline void
+ tree_node_base<Derived>::on_post_propagate_value_once(Key const& key)
+ {
+ this->get_derived()->on_post_propagate_value_once_impl(key);
+ }
+
+ template <typename Derived>
+ template <typename Iterator>
+ inline void
+ tree_node_base<Derived>::on_post_inserted_impl(
+ Iterator position
+ , ::boost::mpl::true_
+ )
+ {
+ }
+
+ template <typename Derived>
+ template <typename Iterator>
+ inline void
+ tree_node_base<Derived>::on_post_inserted_impl(
+ Iterator position
+ , ::boost::mpl::false_
+ )
+ {
+ }
+
+ template <typename Derived>
+ template <typename Iterator, typename BooleanIntegralConstant>
+ inline void
+ tree_node_base<Derived>::on_post_inserted(
+ Iterator position
+ , BooleanIntegralConstant invalidates_sibling_positions
+ )
+ {
+ this->get_derived()->on_post_inserted_impl(
+ position
+ , invalidates_sibling_positions
+ );
+ }
+
+ template <typename Derived>
+ template <typename Iterator>
+ inline void
+ tree_node_base<Derived>::on_post_insert_impl(
+ Iterator itr
+ , Iterator itr_end
+ , ::boost::mpl::true_
+ )
+ {
+ }
+
+ template <typename Derived>
+ template <typename Iterator>
+ inline void
+ tree_node_base<Derived>::on_post_insert_impl(
+ Iterator itr
+ , Iterator itr_end
+ , ::boost::mpl::false_
+ )
+ {
+ }
+
+ template <typename Derived>
+ template <typename Iterator, typename BooleanIntegralConstant>
+ inline void
+ tree_node_base<Derived>::on_post_insert(
+ Iterator itr
+ , Iterator itr_end
+ , BooleanIntegralConstant invalidates_children_positions
+ )
+ {
+ this->get_derived()->on_post_insert_impl(
+ itr
+ , itr_end
+ , invalidates_children_positions
+ );
+ }
+
+ template <typename Derived>
+ inline void tree_node_base<Derived>::on_post_erase_impl()
+ {
+ }
+
+ template <typename Derived>
+ inline void tree_node_base<Derived>::on_post_erase()
+ {
+ this->get_derived()->on_post_erase_impl();
+ }
+
+ template <typename Derived>
+ inline void tree_node_base<Derived>::on_post_clear_impl()
+ {
+ }
+
+ template <typename Derived>
+ inline void tree_node_base<Derived>::on_post_clear()
+ {
+ this->get_derived()->on_post_clear_impl();
+ }
+
+ template <typename Derived>
+ inline void tree_node_base<Derived>::on_post_rotate_left_impl()
+ {
+ }
+
+ template <typename Derived>
+ inline void tree_node_base<Derived>::on_post_rotate_left()
+ {
+ this->get_derived()->on_post_rotate_left_impl();
+ }
+
+ template <typename Derived>
+ inline void tree_node_base<Derived>::on_post_rotate_right_impl()
+ {
+ }
+
+ template <typename Derived>
+ inline void tree_node_base<Derived>::on_post_rotate_right()
+ {
+ this->get_derived()->on_post_rotate_right_impl();
+ }
+}} // namespace boost::tree_node
+
+#endif // BOOST_TREE_NODE_BASE_HPP_INCLUDED
+

Added: sandbox/tree_node/boost/tree_node/binary_node.hpp
==============================================================================
--- (empty file)
+++ sandbox/tree_node/boost/tree_node/binary_node.hpp 2013-03-11 00:49:15 EDT (Mon, 11 Mar 2013)
@@ -0,0 +1,2924 @@
+// Copyright (C) 2011-2013 Cromwell D. Enage
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_TREE_NODE_BINARY_NODE_HPP_INCLUDED
+#define BOOST_TREE_NODE_BINARY_NODE_HPP_INCLUDED
+
+#include <iterator>
+#include <boost/tr1/type_traits.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/apply_wrap.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/container/scoped_allocator_fwd.hpp>
+#include <boost/tree_node/preprocessor.hpp>
+#include <boost/tree_node/base.hpp>
+#include <boost/tree_node/binary_node_fwd.hpp>
+#include <boost/tree_node/traits/binary_node_fwd.hpp>
+#include <boost/tree_node/intrinsic/has_key.hpp>
+#include <boost/tree_node/intrinsic/get_keys.hpp>
+#include <boost/utility/value_init.hpp>
+#include <boost/assert.hpp>
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/move/move.hpp>
+#include <boost/container/allocator_traits.hpp>
+#endif
+
+#if !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#include <boost/preprocessor/repetition/repeat.hpp>
+#endif
+
+#include <boost/tree_node/_detail/config_begin.hpp>
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/type_traits/is_pod.hpp>
+
+namespace boost {
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ struct is_POD<
+ ::boost::tree_node::binary_node_base<Derived,T,Size,Allocator>
+ > : ::boost::false_type
+ {
+ };
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ struct is_pod<
+ ::boost::tree_node::binary_node_base<Derived,T,Size,Allocator>
+ > : ::boost::false_type
+ {
+ };
+} // namespace boost
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/mpl/transform_view.hpp>
+#include <boost/fusion/sequence/intrinsic/at_key.hpp>
+#include <boost/fusion/iterator/key_of.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/fusion/support/category_of.hpp>
+
+namespace boost { namespace tree_node { namespace result_of {
+
+ template <
+ typename Derived
+ , typename T
+ , typename Size
+ , typename Allocator
+ , typename FusionKey
+ >
+ struct has_key_impl<
+ binary_node_base<Derived,T,Size,Allocator>
+ , FusionKey
+ > : ::boost::mpl::eval_if<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::has_key<T,FusionKey>
+ , ::std::tr1::is_same<FusionKey,data_key>
+ >::type
+ {
+ };
+
+ template <
+ typename Derived
+ , typename T
+ , typename Size
+ , typename Allocator
+ >
+ struct get_keys_impl<binary_node_base<Derived,T,Size,Allocator> >
+ : ::boost::mpl::eval_if<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::mpl::transform_view<
+ T
+ , ::boost::fusion::result_of::key_of< ::boost::mpl::_>
+ >
+ , ::boost::mpl::vector1<data_key>
+ >
+ {
+ };
+}}} // namespace boost::tree_node::result_of
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+
+namespace boost { namespace tree_node { namespace _detail {
+
+ template <typename Node, typename IsReverse>
+ class binary_child_iterator
+ {
+#if !defined BOOST_NO_SFINAE
+ struct enabler
+ {
+ };
+#endif
+
+ public:
+ typedef ::std::random_access_iterator_tag iterator_category;
+ typedef Node value_type;
+ typedef ::std::ptrdiff_t difference_type;
+ typedef value_type* pointer;
+ typedef value_type& reference;
+
+ private:
+ class proxy
+ {
+ binary_child_iterator _itr;
+
+ public:
+ proxy(pointer const& p, difference_type n);
+
+ operator binary_child_iterator&();
+ };
+
+ public: // Should be private, but conversion ctor won't work.
+ pointer _current;
+ pointer _parent;
+
+ public:
+ binary_child_iterator();
+
+ explicit binary_child_iterator(pointer const& p);
+
+ binary_child_iterator(pointer const& p, bool p_is_child);
+
+ template <typename N, typename I>
+ binary_child_iterator(
+ binary_child_iterator<N,I> const& other
+#if !defined BOOST_NO_SFINAE
+ , typename ::boost::enable_if<
+ typename ::boost::mpl::if_<
+ ::std::tr1::is_convertible<N,Node>
+ , ::boost::mpl::equal_to<I,IsReverse>
+ , ::boost::mpl::false_
+ >::type
+ , enabler
+ >::type = enabler()
+#endif
+ );
+
+ reference operator*() const;
+
+ pointer operator->() const;
+
+ proxy operator[](difference_type n) const;
+
+ binary_child_iterator& operator++();
+
+ binary_child_iterator operator++(int);
+
+ binary_child_iterator& operator--();
+
+ binary_child_iterator operator--(int);
+
+ binary_child_iterator& operator+=(difference_type n);
+
+ binary_child_iterator operator+(difference_type n) const;
+
+ binary_child_iterator& operator-=(difference_type n);
+
+ binary_child_iterator operator-(difference_type n) const;
+
+ private:
+ void _iterate(pointer const& sibling);
+
+ void _advance(difference_type n);
+
+ template <typename N1, typename I1, typename N2, typename I2>
+ friend
+#if defined BOOST_NO_SFINAE
+ bool
+#else
+ typename ::boost::enable_if< ::boost::mpl::equal_to<I1,I2>,bool>::type
+#endif
+ operator==(
+ binary_child_iterator<N1,I1> const& lhs
+ , binary_child_iterator<N2,I2> const& rhs
+ );
+
+ template <typename N1, typename I1, typename N2, typename I2>
+ friend
+#if defined BOOST_NO_SFINAE
+ bool
+#else
+ typename ::boost::enable_if< ::boost::mpl::equal_to<I1,I2>,bool>::type
+#endif
+ operator<(
+ binary_child_iterator<N1,I1> const& lhs
+ , binary_child_iterator<N2,I2> const& rhs
+ );
+
+ template <typename N1, typename I1, typename N2, typename I2>
+ friend ::std::ptrdiff_t
+ operator-(
+ binary_child_iterator<N1,I1> const& lhs
+ , binary_child_iterator<N2,I2> const& rhs
+ );
+ };
+
+ template <typename Node, typename IsReverse>
+ binary_child_iterator<Node,IsReverse>::proxy::proxy(
+ pointer const& p
+ , difference_type n
+ ) : _itr(p, true)
+ {
+ this->_itr._advance(n);
+ }
+
+ template <typename Node, typename IsReverse>
+ inline binary_child_iterator<
+ Node
+ , IsReverse
+ >::proxy::operator binary_child_iterator&()
+ {
+ return this->_itr;
+ }
+
+ template <typename Node, typename IsReverse>
+ binary_child_iterator<Node,IsReverse>::binary_child_iterator()
+ : _current(::boost::initialized_value)
+ , _parent(::boost::initialized_value)
+ {
+ }
+
+ template <typename Node, typename IsReverse>
+ binary_child_iterator<Node,IsReverse>::binary_child_iterator(
+ pointer const& p
+ , bool p_is_child
+ ) : _current(
+ p_is_child ? p : IsReverse::value ? (
+ p->get_right_child_ptr()
+ ? p->get_right_child_ptr()
+ : p->get_left_child_ptr()
+ ) : (
+ p->get_left_child_ptr()
+ ? p->get_left_child_ptr()
+ : p->get_right_child_ptr()
+ )
+ )
+ , _parent(p_is_child ? p->get_parent_ptr() : p)
+ {
+ }
+
+ template <typename Node, typename IsReverse>
+ binary_child_iterator<Node,IsReverse>::binary_child_iterator(
+ pointer const& p
+ ) : _current(::boost::initialized_value), _parent(p)
+ {
+ }
+
+ template <typename Node, typename IsReverse>
+ template <typename N, typename I>
+ binary_child_iterator<Node,IsReverse>::binary_child_iterator(
+ binary_child_iterator<N,I> const& other
+#if !defined BOOST_NO_SFINAE
+ , typename ::boost::enable_if<
+ typename ::boost::mpl::if_<
+ ::std::tr1::is_convertible<N,Node>
+ , ::boost::mpl::equal_to<I,IsReverse>
+ , ::boost::mpl::false_
+ >::type
+ , enabler
+ >::type
+#endif
+ ) : _current(other._current), _parent(other._parent)
+ {
+ }
+
+ template <typename Node, typename IsReverse>
+ inline typename binary_child_iterator<Node,IsReverse>::reference
+ binary_child_iterator<Node,IsReverse>::operator*() const
+ {
+ return *this->_current;
+ }
+
+ template <typename Node, typename IsReverse>
+ inline typename binary_child_iterator<Node,IsReverse>::pointer
+ binary_child_iterator<Node,IsReverse>::operator->() const
+ {
+ return this->_current;
+ }
+
+ template <typename Node, typename IsReverse>
+ inline typename binary_child_iterator<Node,IsReverse>::proxy
+ binary_child_iterator<Node,IsReverse>::operator[](
+ difference_type n
+ ) const
+ {
+ return proxy(this->_current, n);
+ }
+
+ template <typename Node, typename IsReverse>
+ inline binary_child_iterator<Node,IsReverse>&
+ binary_child_iterator<Node,IsReverse>::operator++()
+ {
+ this->_iterate(
+ IsReverse::value
+ ? this->_parent->get_left_child_ptr()
+ : this->_parent->get_right_child_ptr()
+ );
+ return *this;
+ }
+
+ template <typename Node, typename IsReverse>
+ binary_child_iterator<Node,IsReverse>
+ binary_child_iterator<Node,IsReverse>::operator++(int)
+ {
+ binary_child_iterator itr(*this);
+ ++(*this);
+ return itr;
+ }
+
+ template <typename Node, typename IsReverse>
+ inline binary_child_iterator<Node,IsReverse>&
+ binary_child_iterator<Node,IsReverse>::operator--()
+ {
+ if (this->_current)
+ {
+ this->_iterate(
+ IsReverse::value
+ ? this->_parent->get_right_child_ptr()
+ : this->_parent->get_left_child_ptr()
+ );
+ }
+ else if (IsReverse::value)
+ {
+ this->_current = this->_parent->get_left_child_ptr();
+
+ if (!this->_current)
+ {
+ this->_current = this->_parent->get_right_child_ptr();
+ }
+ }
+ else
+ {
+ this->_current = this->_parent->get_right_child_ptr();
+
+ if (!this->_current)
+ {
+ this->_current = this->_parent->get_left_child_ptr();
+ }
+ }
+
+ BOOST_ASSERT_MSG(this->_current, "Result not dereferenceable.");
+ return *this;
+ }
+
+ template <typename Node, typename IsReverse>
+ binary_child_iterator<Node,IsReverse>
+ binary_child_iterator<Node,IsReverse>::operator--(int)
+ {
+ binary_child_iterator itr(*this);
+ --(*this);
+ return itr;
+ }
+
+ template <typename Node, typename IsReverse>
+ inline binary_child_iterator<Node,IsReverse>&
+ binary_child_iterator<Node,IsReverse>::operator+=(difference_type n)
+ {
+ this->_advance(n);
+ return *this;
+ }
+
+ template <typename Node, typename IsReverse>
+ binary_child_iterator<Node,IsReverse>
+ binary_child_iterator<Node,IsReverse>::operator+(
+ difference_type n
+ ) const
+ {
+ binary_child_iterator itr(*this);
+ itr += n;
+ return itr;
+ }
+
+ template <typename Node, typename IsReverse>
+ inline binary_child_iterator<Node,IsReverse>&
+ binary_child_iterator<Node,IsReverse>::operator-=(difference_type n)
+ {
+ this->_advance(-n);
+ return *this;
+ }
+
+ template <typename Node, typename IsReverse>
+ binary_child_iterator<Node,IsReverse>
+ binary_child_iterator<Node,IsReverse>::operator-(
+ difference_type n
+ ) const
+ {
+ binary_child_iterator itr(*this);
+ itr -= n;
+ return itr;
+ }
+
+ template <typename Node, typename IsReverse>
+ inline void
+ binary_child_iterator<Node,IsReverse>::_iterate(pointer const& sibling)
+ {
+ this->_current = (
+ this->_current == sibling
+ ) ? ::boost::initialized_value : sibling;
+ }
+
+ template <typename Node, typename IsReverse>
+ inline void
+ binary_child_iterator<Node,IsReverse>::_advance(difference_type n)
+ {
+ switch (n)
+ {
+ case -2:
+ {
+ BOOST_ASSERT_MSG(
+ (
+ IsReverse::value
+ ? (
+ (
+ this->_current == (
+ this->_parent->get_left_child_ptr()
+ )
+ ) && this->_parent->get_right_child_ptr()
+ )
+ : (
+ (
+ this->_current == (
+ this->_parent->get_right_child_ptr()
+ )
+ ) && this->_parent->get_left_child_ptr()
+ )
+ )
+ , "n must be greater than -2."
+ );
+
+ this->_current = ::boost::initialized_value;
+ break;
+ }
+
+ case -1:
+ {
+ --(*this);
+ break;
+ }
+
+ case 0:
+ {
+ break;
+ }
+
+ case 1:
+ {
+ ++(*this);
+ break;
+ }
+
+ case 2:
+ {
+ BOOST_ASSERT_MSG(
+ (
+ IsReverse::value
+ ? (
+ (
+ this->_current == (
+ this->_parent->get_right_child_ptr()
+ )
+ ) && this->_parent->get_left_child_ptr()
+ )
+ : (
+ (
+ this->_current == (
+ this->_parent->get_left_child_ptr()
+ )
+ ) && this->_parent->get_right_child_ptr()
+ )
+ )
+ , "n must be less than 2."
+ );
+
+ this->_current = ::boost::initialized_value;
+ break;
+ }
+
+ default:
+ {
+ BOOST_ASSERT_MSG(false, "|n| must be less than 3.");
+ }
+ }
+ }
+
+ template <typename Node1, typename IsR1, typename Node2, typename IsR2>
+ inline
+#if defined BOOST_NO_SFINAE
+ bool
+#else
+ typename ::boost::enable_if< ::boost::mpl::equal_to<IsR1,IsR2>,bool>::type
+#endif
+ operator==(
+ binary_child_iterator<Node1,IsR1> const& lhs
+ , binary_child_iterator<Node2,IsR2> const& rhs
+ )
+ {
+ return lhs._current == rhs._current;
+ }
+
+ template <typename Node1, typename IsR1, typename Node2, typename IsR2>
+ inline
+#if defined BOOST_NO_SFINAE
+ bool
+#else
+ typename ::boost::enable_if< ::boost::mpl::equal_to<IsR1,IsR2>,bool>::type
+#endif
+ operator!=(
+ binary_child_iterator<Node1,IsR1> const& lhs
+ , binary_child_iterator<Node2,IsR2> const& rhs
+ )
+ {
+ return !(lhs == rhs);
+ }
+
+ template <typename Node1, typename IsR1, typename Node2, typename IsR2>
+ inline
+#if defined BOOST_NO_SFINAE
+ bool
+#else
+ typename ::boost::enable_if< ::boost::mpl::equal_to<IsR1,IsR2>,bool>::type
+#endif
+ operator<(
+ binary_child_iterator<Node1,IsR1> const& lhs
+ , binary_child_iterator<Node2,IsR2> const& rhs
+ )
+ {
+ BOOST_ASSERT_MSG(lhs._parent, "lhs is unreachable.");
+ BOOST_ASSERT_MSG(rhs._parent, "rhs is unreachable.");
+ BOOST_ASSERT_MSG(
+ rhs._parent == lhs._parent
+ , "Neither iterator is reachable from one other."
+ );
+
+ if (lhs._current)
+ {
+ if (rhs._current)
+ {
+ return rhs._current == lhs._parent->get_right_child_ptr();
+ }
+ else
+ {
+ return true;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ template <typename Node1, typename IsR1, typename Node2, typename IsR2>
+ inline
+#if defined BOOST_NO_SFINAE
+ bool
+#else
+ typename ::boost::enable_if< ::boost::mpl::equal_to<IsR1,IsR2>,bool>::type
+#endif
+ operator>(
+ binary_child_iterator<Node1,IsR1> const& lhs
+ , binary_child_iterator<Node2,IsR2> const& rhs
+ )
+ {
+ return rhs < lhs;
+ }
+
+ template <typename Node1, typename IsR1, typename Node2, typename IsR2>
+ inline
+#if defined BOOST_NO_SFINAE
+ bool
+#else
+ typename ::boost::enable_if< ::boost::mpl::equal_to<IsR1,IsR2>,bool>::type
+#endif
+ operator<=(
+ binary_child_iterator<Node1,IsR1> const& lhs
+ , binary_child_iterator<Node2,IsR2> const& rhs
+ )
+ {
+ return !(rhs < lhs);
+ }
+
+ template <typename Node1, typename IsR1, typename Node2, typename IsR2>
+ inline
+#if defined BOOST_NO_SFINAE
+ bool
+#else
+ typename ::boost::enable_if< ::boost::mpl::equal_to<IsR1,IsR2>,bool>::type
+#endif
+ operator>=(
+ binary_child_iterator<Node1,IsR1> const& lhs
+ , binary_child_iterator<Node2,IsR2> const& rhs
+ )
+ {
+ return !(lhs < rhs);
+ }
+
+ template <typename Node, typename IsReverse>
+ inline binary_child_iterator<Node,IsReverse>
+ operator+(
+ typename binary_child_iterator<Node,IsReverse>::difference_type n
+ , binary_child_iterator<Node,IsReverse> const& itr
+ )
+ {
+ return itr + n;
+ }
+
+ template <typename Node1, typename IsR1, typename Node2, typename IsR2>
+ inline ::std::ptrdiff_t
+ operator-(
+ binary_child_iterator<Node1,IsR1> const& lhs
+ , binary_child_iterator<Node2,IsR2> const& rhs
+ )
+ {
+ BOOST_ASSERT_MSG(lhs._parent, "lhs is unreachable.");
+ BOOST_ASSERT_MSG(rhs._parent, "rhs is unreachable.");
+ BOOST_ASSERT_MSG(
+ rhs._parent == lhs._parent
+ , "Neither iterator is reachable from one other."
+ );
+
+ if (lhs._current == rhs._current)
+ {
+ return 0;
+ }
+ else if (lhs._current)
+ {
+ if (rhs._current)
+ {
+ return (
+ rhs._current == lhs._parent->get_left_child_ptr()
+ ) ? 1 : -1;
+ }
+ else
+ {
+ return (
+ lhs._parent->get_left_child_ptr() && (
+ lhs._parent->get_right_child_ptr()
+ )
+ ) ? 2 : 1;
+ }
+ }
+ else
+ {
+ return (
+ rhs._parent->get_left_child_ptr() && (
+ rhs._parent->get_right_child_ptr()
+ )
+ ) ? -2 : -1;
+ }
+ }
+}}} // namespace boost::tree_node::_detail
+
+namespace boost { namespace tree_node {
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ class binary_node_base
+ : public
+ //[reference__binary_node_base__bases
+ tree_node_base<Derived>
+ //]
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ , public data_key
+#endif
+ , private ::boost::noncopyable
+ {
+ template <typename D>
+ friend struct binary_node_traits;
+
+ public:
+ //[reference__binary_node_base__super_t
+ typedef tree_node_base<Derived> super_t;
+ //]
+
+ //[reference__binary_node_base__traits
+ struct traits
+ {
+ typedef T
+ data_type;
+ typedef typename ::std::tr1::remove_reference<Allocator>::type
+ allocator;
+ typedef typename ::boost::mpl::if_<
+ ::std::tr1::is_reference<Allocator>
+ , Allocator
+ , typename ::std::tr1::add_reference<
+ typename ::std::tr1::add_const<Allocator>::type
+ >::type
+ >::type
+ allocator_reference;
+ };
+ //]
+
+ //[reference__binary_node_base__pointer
+ typedef typename super_t::pointer pointer;
+ //]
+
+ //[reference__binary_node_base__const_pointer
+ typedef typename super_t::const_pointer const_pointer;
+ //]
+
+ typedef _detail::binary_child_iterator<Derived,::boost::mpl::false_>
+ iterator;
+ typedef _detail::binary_child_iterator<
+ Derived const
+ , ::boost::mpl::false_
+ >
+ const_iterator;
+ typedef _detail::binary_child_iterator<Derived,::boost::mpl::true_>
+ reverse_iterator;
+ typedef _detail::binary_child_iterator<
+ Derived const
+ , ::boost::mpl::true_
+ >
+ const_reverse_iterator;
+
+#if 0
+ //[reference__binary_node_base__iterator
+ typedef implementation_defined iterator;
+ //]
+
+ //[reference__binary_node_base__const_iterator
+ typedef implementation_defined const_iterator;
+ //]
+
+ //[reference__binary_node_base__reverse_iterator
+ typedef implementation_defined reverse_iterator;
+ //]
+
+ //[reference__binary_node_base__const_reverse_iterator
+ typedef implementation_defined const_reverse_iterator;
+ //]
+#endif
+
+ //[reference__binary_node_base__size_type
+ typedef Size size_type;
+ //]
+
+ private:
+ typename traits::data_type _data;
+ Allocator _allocator;
+ pointer _left_child;
+ pointer _right_child;
+ pointer _parent;
+
+ protected:
+ //[reference__binary_node_base__derived_copy_ctor
+ binary_node_base(Derived const& copy);
+ //]
+
+ //[reference__binary_node_base__derived_copy_ctor_w_allocator
+ binary_node_base(
+ Derived const& copy
+ , typename traits::allocator_reference allocator
+ );
+ //]
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ binary_node_base(BOOST_RV_REF(Derived) source);
+
+ binary_node_base(
+ BOOST_RV_REF(Derived) source
+ , typename traits::allocator_reference allocator
+ );
+#endif
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ //[reference__binary_node_base__emplacement_ctor
+ template <typename ...Args>
+ explicit binary_node_base(Args&& ...args);
+ //]
+
+ //[reference__binary_node_base__emplacement_ctor_w_allocator
+ template <typename ...Args>
+ explicit binary_node_base(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ );
+ //]
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_FWD_DECL
+ , binary_node_base
+ )
+
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_W_ALLOC_FWD_DECL
+ , binary_node_base
+ )
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ ~binary_node_base();
+
+ //[reference__binary_node_base__on_post_copy_or_move
+ void on_post_copy_or_move();
+ //]
+
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ //[reference__binary_node_base__copy_assign
+ void copy_assign(Derived const& copy);
+ //]
+#else
+ void copy_assign(BOOST_COPY_ASSIGN_REF(Derived) copy);
+
+ void move_assign(BOOST_RV_REF(Derived) source);
+#endif
+
+ public:
+ //[reference__binary_node_base__key_value_operator__const
+ typename traits::data_type const& operator[](data_key const&) const;
+
+//<-
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+//->
+ template <typename FusionKey>
+ typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ binary_node_base<Derived,T,Size,Allocator>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<T const,FusionKey>
+ >::type
+ operator[](FusionKey const&) const;
+//<-
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+//->
+ //]
+
+ //[reference__binary_node_base__key_value_operator
+ typename traits::data_type& operator[](data_key const&);
+
+//<-
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+//->
+ template <typename FusionKey>
+ typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ binary_node_base<Derived,T,Size,Allocator>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<T,FusionKey>
+ >::type
+ operator[](FusionKey const&);
+//<-
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+//->
+ //]
+
+ //[reference__binary_node_base__get_parent_ptr__const
+ const_pointer get_parent_ptr() const;
+ //]
+
+ //[reference__binary_node_base__get_parent_ptr
+ pointer get_parent_ptr();
+ //]
+
+ //[reference__binary_node_base__insert_left
+ iterator insert_left(Derived const& child);
+ //]
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ //[reference__binary_node_base__emplace_left
+ template <typename ...Args>
+ iterator emplace_left(Args&& ...args);
+ //]
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#define BOOST_TREE_NODE_BINARY_NODE_MACRO(z, n, _) \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ iterator \
+ emplace_left( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ); \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_BINARY_NODE_MACRO
+ , _
+ )
+#undef BOOST_TREE_NODE_BINARY_NODE_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ //[reference__binary_node_base__insert_right
+ iterator insert_right(Derived const& child);
+ //]
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ //[reference__binary_node_base__emplace_right
+ template <typename ...Args>
+ iterator emplace_right(Args&& ...args);
+ //]
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#define BOOST_TREE_NODE_BINARY_NODE_MACRO(z, n, _) \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ iterator \
+ emplace_right( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ); \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_BINARY_NODE_MACRO
+ , _
+ )
+#undef BOOST_TREE_NODE_BINARY_NODE_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ //[reference__binary_node_base__get_left_child_ptr__const
+ const_pointer get_left_child_ptr() const;
+ //]
+
+ //[reference__binary_node_base__get_left_child_ptr
+ pointer get_left_child_ptr();
+ //]
+
+ //[reference__binary_node_base__get_right_child_ptr__const
+ const_pointer get_right_child_ptr() const;
+ //]
+
+ //[reference__binary_node_base__get_right_child_ptr
+ pointer get_right_child_ptr();
+ //]
+
+ //[reference__binary_node_base__cbegin
+ const_iterator cbegin() const;
+ const_iterator begin() const;
+ //]
+
+ //[reference__binary_node_base__begin
+ iterator begin();
+ //]
+
+ //[reference__binary_node_base__cend
+ const_iterator cend() const;
+ const_iterator end() const;
+ //]
+
+ //[reference__binary_node_base__end
+ iterator end();
+ //]
+
+ //[reference__binary_node_base__crbegin
+ const_reverse_iterator crbegin() const;
+ const_reverse_iterator rbegin() const;
+ //]
+
+ //[reference__binary_node_base__rbegin
+ reverse_iterator rbegin();
+ //]
+
+ //[reference__binary_node_base__crend
+ const_reverse_iterator crend() const;
+ const_reverse_iterator rend() const;
+ //]
+
+ //[reference__binary_node_base__rend
+ reverse_iterator rend();
+ //]
+
+ //[reference__binary_node_base__size
+ size_type size() const;
+ //]
+
+ //[reference__binary_node_base__empty
+ bool empty() const;
+ //]
+
+ //[reference__binary_node_base__clear
+ void clear();
+ //]
+
+ //[reference__binary_node_base__rotate_left
+ pointer rotate_left();
+ //]
+
+ //[reference__binary_node_base__rotate_right
+ pointer rotate_right();
+ //]
+
+ //[reference__binary_node_base__erase_left
+ bool erase_left();
+ //]
+
+ //[reference__binary_node_base__erase_right
+ bool erase_right();
+ //]
+
+ private:
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ static typename traits::allocator_reference
+ _construct_from(
+ typename traits::allocator_reference allocator
+ , ::std::tr1::true_type
+ );
+
+ static Allocator
+ _construct_from(
+ typename traits::allocator_reference allocator
+ , ::std::tr1::false_type
+ );
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ iterator _add_child(pointer const& child);
+
+ void _link_children_to_parent();
+
+ void _on_post_modify_value(data_key const& key);
+
+ void _set_parent_ptr(pointer p);
+
+ void _set_left_child_ptr(pointer p);
+
+ void _set_right_child_ptr(pointer p);
+
+ template <typename D, typename T0, typename S, typename A, typename V>
+ friend void
+ put(binary_node_base<D,T0,S,A>&, data_key const&, V const&);
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ template <typename FusionKey>
+ void _on_post_modify_value(FusionKey const& key);
+
+ template <
+ typename D
+ , typename T0
+ , typename S
+ , typename A
+ , typename FK
+ , typename V
+ >
+ friend void
+ put(
+ binary_node_base<D,T0,S,A>& node
+ , FK const& key
+ , V const& value
+ , typename ::boost::enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T0>::type
+ , ::boost::fusion::traits::is_associative<T0>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<binary_node_base<D,T0,S,A>,FK>
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::mpl::true_
+ >::type
+ );
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+ };
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ binary_node_base<Derived,T,Size,Allocator>::binary_node_base(
+ Derived const& copy
+ ) : _data(copy._data)
+ , _allocator(
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ copy._allocator
+#else
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::select_on_container_copy_construction(copy._allocator)
+#endif
+ )
+ , _left_child(
+ copy._left_child ? (
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ this->_allocator.allocate(1)
+#else
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::allocate(this->_allocator, 1)
+#endif
+ ) : ::boost::initialized_value
+ )
+ , _right_child(
+ copy._right_child ? (
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ this->_allocator.allocate(1)
+#else
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::allocate(this->_allocator, 1)
+#endif
+ ) : ::boost::initialized_value
+ )
+ , _parent(::boost::initialized_value)
+ {
+ if (this->_left_child)
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ this->_allocator.construct(
+ this->_left_child
+ , *copy.get_left_child_ptr()
+ );
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::construct(
+ this->_allocator
+ , this->_left_child
+ , *copy.get_left_child_ptr()
+ );
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ }
+
+ if (this->_right_child)
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ this->_allocator.construct(
+ this->_right_child
+ , *copy.get_right_child_ptr()
+ );
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::construct(
+ this->_allocator
+ , this->_right_child
+ , *copy.get_right_child_ptr()
+ );
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ }
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ binary_node_base<Derived,T,Size,Allocator>::binary_node_base(
+ Derived const& copy
+ , typename traits::allocator_reference allocator
+ ) : _data(copy._data)
+ , _allocator(
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ allocator
+#else
+ this->_construct_from(
+ allocator
+ , typename ::std::tr1::is_reference<Allocator>::type()
+ )
+#endif
+ )
+ , _left_child(
+ copy._left_child ? (
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ this->_allocator.allocate(1)
+#else
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::allocate(this->_allocator, 1)
+#endif
+ ) : ::boost::initialized_value
+ )
+ , _right_child(
+ copy._right_child ? (
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ this->_allocator.allocate(1)
+#else
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::allocate(this->_allocator, 1)
+#endif
+ ) : ::boost::initialized_value
+ )
+ , _parent(::boost::initialized_value)
+ {
+ if (this->_left_child)
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ this->_allocator.construct(
+ this->_left_child
+ , *copy.get_left_child_ptr()
+ , allocator
+ );
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::construct(
+ this->_allocator
+ , this->_left_child
+ , *copy.get_left_child_ptr()
+ , allocator
+ );
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ }
+
+ if (this->_right_child)
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ this->_allocator.construct(
+ this->_right_child
+ , *copy.get_right_child_ptr()
+ , allocator
+ );
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::construct(
+ this->_allocator
+ , this->_right_child
+ , *copy.get_right_child_ptr()
+ , allocator
+ );
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ }
+ }
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ binary_node_base<Derived,T,Size,Allocator>::binary_node_base(
+ BOOST_RV_REF(Derived) source
+ ) : _data(::boost::move(source._data))
+ , _allocator(::boost::move(source._allocator))
+ , _left_child(source._left_child)
+ , _right_child(source._right_child)
+ , _parent(::boost::initialized_value)
+ {
+ source._left_child = source._right_child = ::boost::initialized_value;
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ binary_node_base<Derived,T,Size,Allocator>::binary_node_base(
+ BOOST_RV_REF(Derived) source
+ , typename traits::allocator_reference allocator
+ ) : _data(::boost::move(source._data))
+ , _allocator(
+ this->_construct_from(
+ allocator
+ , typename ::std::tr1::is_reference<Allocator>::type()
+ )
+ )
+ , _left_child(source._left_child)
+ , _right_child(source._right_child)
+ , _parent(::boost::initialized_value)
+ {
+ source._left_child = source._right_child = ::boost::initialized_value;
+ }
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ template <typename ...Args>
+ binary_node_base<Derived,T,Size,Allocator>::binary_node_base(
+ Args&& ...args
+ ) : _data(::boost::forward<Args>(args)...)
+ , _allocator()
+ , _left_child(::boost::initialized_value)
+ , _right_child(::boost::initialized_value)
+ , _parent(::boost::initialized_value)
+ {
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ template <typename ...Args>
+ binary_node_base<Derived,T,Size,Allocator>::binary_node_base(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ ) : _data(::boost::forward<Args>(args)...)
+ , _allocator(
+ this->_construct_from(
+ allocator
+ , typename ::std::tr1::is_reference<Allocator>::type()
+ )
+ )
+ , _left_child(::boost::initialized_value)
+ , _right_child(::boost::initialized_value)
+ , _parent(::boost::initialized_value)
+ {
+ }
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#define BOOST_TREE_NODE_BINARY_NODE_MACRO(z, n, _) \
+ template < \
+ typename Derived \
+ , typename T \
+ , typename Size \
+ , typename Allocator \
+ > \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ binary_node_base<Derived,T,Size,Allocator>::binary_node_base( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ) : _data( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_FORWARD \
+ , _ \
+ ) \
+ ) \
+ , _allocator() \
+ , _left_child(::boost::initialized_value) \
+ , _right_child(::boost::initialized_value) \
+ , _parent(::boost::initialized_value) \
+ { \
+ } \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_BINARY_NODE_MACRO
+ , _
+ )
+#undef BOOST_TREE_NODE_BINARY_NODE_MACRO
+
+#define BOOST_TREE_NODE_BINARY_NODE_MACRO(z, n, _) \
+ template < \
+ typename Derived \
+ , typename T \
+ , typename Size \
+ , typename Allocator \
+ > \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ binary_node_base<Derived,T,Size,Allocator>::binary_node_base( \
+ ::boost::container::allocator_arg_t \
+ , typename traits::allocator_reference allocator \
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ) : _data( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_FORWARD \
+ , _ \
+ ) \
+ ) \
+ , _allocator( \
+ this->_construct_from( \
+ allocator \
+ , typename ::std::tr1::is_reference<Allocator>::type() \
+ ) \
+ ) \
+ , _left_child(::boost::initialized_value) \
+ , _right_child(::boost::initialized_value) \
+ , _parent(::boost::initialized_value) \
+ { \
+ } \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_BINARY_NODE_MACRO
+ , _
+ )
+#undef BOOST_TREE_NODE_BINARY_NODE_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ binary_node_base<Derived,T,Size,Allocator>::~binary_node_base()
+ {
+ if (this->_left_child)
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ this->_allocator.destroy(this->_left_child);
+ this->_allocator.deallocate(this->_left_child, 1);
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::destroy(this->_allocator, this->_left_child);
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::deallocate(this->_allocator, this->_left_child, 1);
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ }
+
+ if (this->_right_child)
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ this->_allocator.destroy(this->_right_child);
+ this->_allocator.deallocate(this->_right_child, 1);
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::destroy(this->_allocator, this->_right_child);
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::deallocate(this->_allocator, this->_right_child, 1);
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ }
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline void
+ binary_node_base<Derived,T,Size,Allocator>::on_post_copy_or_move()
+ {
+ this->_link_children_to_parent();
+ this->on_post_modify_value(data_key());
+ }
+
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ void
+ binary_node_base<Derived,T,Size,Allocator>::copy_assign(
+ Derived const& copy
+ )
+ {
+ Derived twin(copy);
+
+ if (this->_left_child)
+ {
+ this->_allocator.destroy(this->_left_child);
+ this->_allocator.deallocate(this->_left_child, 1);
+ }
+
+ if (this->_right_child)
+ {
+ this->_allocator.destroy(this->_right_child);
+ this->_allocator.deallocate(this->_right_child, 1);
+ }
+
+ this->_data = twin._data;
+ this->_left_child = twin._left_child;
+ this->_right_child = twin._right_child;
+ twin._left_child = twin._right_child = ::boost::initialized_value;
+ }
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ void
+ binary_node_base<Derived,T,Size,Allocator>::copy_assign(
+ BOOST_COPY_ASSIGN_REF(Derived) copy
+ )
+ {
+ Derived twin(static_cast<Derived const&>(copy));
+
+ if (this->_left_child)
+ {
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::destroy(this->_allocator, this->_left_child);
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::deallocate(this->_allocator, this->_left_child, 1);
+ }
+
+ if (this->_right_child)
+ {
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::destroy(this->_allocator, this->_right_child);
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::deallocate(this->_allocator, this->_right_child, 1);
+ }
+
+ this->_data = ::boost::move(twin._data);
+ this->_left_child = twin._left_child;
+ this->_right_child = twin._right_child;
+ twin._left_child = twin._right_child = ::boost::initialized_value;
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline void
+ binary_node_base<Derived,T,Size,Allocator>::move_assign(
+ BOOST_RV_REF(Derived) source
+ )
+ {
+ if (this->_left_child)
+ {
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::destroy(this->_allocator, this->_left_child);
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::deallocate(this->_allocator, this->_left_child, 1);
+ }
+
+ if (this->_right_child)
+ {
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::destroy(this->_allocator, this->_right_child);
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::deallocate(this->_allocator, this->_right_child, 1);
+ }
+
+ this->_data = ::boost::move(source._data);
+ this->_left_child = source._left_child;
+ this->_right_child = source._right_child;
+ source._left_child = source._right_child = ::boost::initialized_value;
+ }
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<
+ Derived
+ , T
+ , Size
+ , Allocator
+ >::traits::data_type const&
+ binary_node_base<Derived,T,Size,Allocator>::operator[](
+ data_key const&
+ ) const
+ {
+ return this->_data;
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<
+ Derived
+ , T
+ , Size
+ , Allocator
+ >::traits::data_type&
+ binary_node_base<Derived,T,Size,Allocator>::operator[](data_key const&)
+ {
+ return this->_data;
+ }
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ template <typename FusionKey>
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ binary_node_base<Derived,T,Size,Allocator>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<T const,FusionKey>
+ >::type
+ binary_node_base<Derived,T,Size,Allocator>::operator[](
+ FusionKey const&
+ ) const
+ {
+ return ::boost::fusion::at_key<FusionKey>(this->_data);
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ template <typename FusionKey>
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ binary_node_base<Derived,T,Size,Allocator>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<T,FusionKey>
+ >::type
+ binary_node_base<Derived,T,Size,Allocator>::operator[](
+ FusionKey const&
+ )
+ {
+ return ::boost::fusion::at_key<FusionKey>(this->_data);
+ }
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<Derived,T,Size,Allocator>::const_pointer
+ binary_node_base<Derived,T,Size,Allocator>::get_parent_ptr() const
+ {
+ return this->_parent;
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<Derived,T,Size,Allocator>::pointer
+ binary_node_base<Derived,T,Size,Allocator>::get_parent_ptr()
+ {
+ return this->_parent;
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ typename binary_node_base<Derived,T,Size,Allocator>::iterator
+ binary_node_base<Derived,T,Size,Allocator>::insert_left(
+ Derived const& child
+ )
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ pointer p(this->_allocator.allocate(1));
+ this->_allocator.construct(p, child);
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ pointer p(
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::allocate(this->_allocator, 1)
+ );
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::construct(this->_allocator, p, child);
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ pointer c = p->_left_child;
+
+ if (c)
+ {
+ while (c->_left_child)
+ {
+ c = c->_left_child;
+ }
+
+ c->_add_child(c->_left_child = this->_left_child);
+ this->_left_child = ::boost::initialized_value;
+ this->on_post_erase();
+ }
+
+ return this->_add_child(this->_left_child = p);
+ }
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ template <typename ...Args>
+ typename binary_node_base<Derived,T,Size,Allocator>::iterator
+ binary_node_base<Derived,T,Size,Allocator>::emplace_left(
+ Args&& ...args
+ )
+ {
+ if (this->_left_child)
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ pointer p(this->_allocator.allocate(1));
+ this->_allocator.construct(p, ::boost::forward<Args>(args)...);
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ pointer p(
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::allocate(this->_allocator, 1)
+ );
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::construct(this->_allocator, p, ::boost::forward<Args>(args)...);
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ p->_add_child(p->_left_child = this->_left_child);
+ this->_left_child = ::boost::initialized_value;
+ this->on_post_erase();
+ return this->_add_child(this->_left_child = p);
+ }
+ else
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ this->_allocator.construct(
+ this->_left_child = this->_allocator.allocate(1)
+ , ::boost::forward<Args>(args)...
+ );
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::construct(
+ this->_allocator
+ , this->_left_child = ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::allocate(this->_allocator, 1)
+ , ::boost::forward<Args>(args)...
+ );
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ return this->_add_child(this->_left_child);
+ }
+ }
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#define BOOST_TREE_NODE_BINARY_NODE_MACRO(z, n, _) \
+ template < \
+ typename Derived \
+ , typename T \
+ , typename Size \
+ , typename Allocator \
+ > \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ typename binary_node_base<Derived,T,Size,Allocator>::iterator \
+ binary_node_base<Derived,T,Size,Allocator>::emplace_left( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ) \
+ { \
+ if (this->_left_child) \
+ { \
+ pointer p(this->_allocator.allocate(1)); \
+ this->_allocator.construct( \
+ p \
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_FORWARD \
+ , _ \
+ ) \
+ ); \
+ p->_add_child(p->_left_child = this->_left_child); \
+ this->_left_child = ::boost::initialized_value; \
+ this->on_post_erase(); \
+ return this->_add_child(this->_left_child = p); \
+ } \
+ else \
+ { \
+ this->_allocator.construct( \
+ this->_left_child = this->_allocator.allocate(1) \
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_FORWARD \
+ , _ \
+ ) \
+ ); \
+ return this->_add_child(this->_left_child); \
+ } \
+ } \
+//!
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#define BOOST_TREE_NODE_BINARY_NODE_MACRO(z, n, _) \
+ template < \
+ typename Derived \
+ , typename T \
+ , typename Size \
+ , typename Allocator \
+ > \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ typename binary_node_base<Derived,T,Size,Allocator>::iterator \
+ binary_node_base<Derived,T,Size,Allocator>::emplace_left( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ) \
+ { \
+ if (this->_left_child) \
+ { \
+ pointer p( \
+ ::boost::container::allocator_traits< \
+ typename traits::allocator \
+ >::allocate(this->_allocator, 1) \
+ ); \
+ ::boost::container::allocator_traits< \
+ typename traits::allocator \
+ >::construct( \
+ this->_allocator \
+ , p \
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_FORWARD \
+ , _ \
+ ) \
+ ); \
+ p->_add_child(p->_left_child = this->_left_child); \
+ this->_left_child = ::boost::initialized_value; \
+ this->on_post_erase(); \
+ return this->_add_child(this->_left_child = p); \
+ } \
+ else \
+ { \
+ ::boost::container::allocator_traits< \
+ typename traits::allocator \
+ >::construct( \
+ this->_allocator \
+ , this->_left_child = ::boost::container::allocator_traits< \
+ typename traits::allocator \
+ >::allocate(this->_allocator, 1) \
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_FORWARD \
+ , _ \
+ ) \
+ ); \
+ return this->_add_child(this->_left_child); \
+ } \
+ } \
+//!
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_BINARY_NODE_MACRO
+ , _
+ )
+#undef BOOST_TREE_NODE_BINARY_NODE_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ typename binary_node_base<Derived,T,Size,Allocator>::iterator
+ binary_node_base<Derived,T,Size,Allocator>::insert_right(
+ Derived const& child
+ )
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ pointer p(this->_allocator.allocate(1));
+ this->_allocator.construct(p, child);
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ pointer p(
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::allocate(this->_allocator, 1)
+ );
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::construct(this->_allocator, p, child);
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ pointer c = p->_right_child;
+
+ if (c)
+ {
+ while (c->_right_child)
+ {
+ c = c->_right_child;
+ }
+
+ c->_add_child(c->_right_child = this->_right_child);
+ this->_right_child = ::boost::initialized_value;
+ this->on_post_erase();
+ }
+
+ return this->_add_child(this->_right_child = p);
+ }
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ template <typename ...Args>
+ typename binary_node_base<Derived,T,Size,Allocator>::iterator
+ binary_node_base<Derived,T,Size,Allocator>::emplace_right(
+ Args&& ...args
+ )
+ {
+ if (this->_right_child)
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ pointer p(this->_allocator.allocate(1));
+ this->_allocator.construct(p, ::boost::forward<Args>(args)...);
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ pointer p(
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::allocate(this->_allocator, 1)
+ );
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::construct(this->_allocator, p, ::boost::forward<Args>(args)...);
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ p->_add_child(p->_right_child = this->_right_child);
+ this->_right_child = ::boost::initialized_value;
+ this->on_post_erase();
+ return this->_add_child(this->_right_child = p);
+ }
+ else
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ this->_allocator.construct(
+ this->_right_child = this->_allocator.allocate(1)
+ , ::boost::forward<Args>(args)...
+ );
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::construct(
+ this->_allocator
+ , this->_right_child = ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::allocate(this->_allocator, 1)
+ , ::boost::forward<Args>(args)...
+ );
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ return this->_add_child(this->_right_child);
+ }
+ }
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#define BOOST_TREE_NODE_BINARY_NODE_MACRO(z, n, _) \
+ template < \
+ typename Derived \
+ , typename T \
+ , typename Size \
+ , typename Allocator \
+ > \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ typename binary_node_base<Derived,T,Size,Allocator>::iterator \
+ binary_node_base<Derived,T,Size,Allocator>::emplace_right( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ) \
+ { \
+ if (this->_right_child) \
+ { \
+ pointer p(this->_allocator.allocate(1)); \
+ this->_allocator.construct( \
+ p \
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_FORWARD \
+ , _ \
+ ) \
+ ); \
+ p->_add_child(p->_right_child = this->_right_child); \
+ this->_right_child = ::boost::initialized_value; \
+ this->on_post_erase(); \
+ return this->_add_child(this->_right_child = p); \
+ } \
+ else \
+ { \
+ this->_allocator.construct( \
+ this->_right_child = this->_allocator.allocate(1) \
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_FORWARD \
+ , _ \
+ ) \
+ ); \
+ return this->_add_child(this->_right_child); \
+ } \
+ } \
+//!
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#define BOOST_TREE_NODE_BINARY_NODE_MACRO(z, n, _) \
+ template < \
+ typename Derived \
+ , typename T \
+ , typename Size \
+ , typename Allocator \
+ > \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ typename binary_node_base<Derived,T,Size,Allocator>::iterator \
+ binary_node_base<Derived,T,Size,Allocator>::emplace_right( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ) \
+ { \
+ if (this->_right_child) \
+ { \
+ pointer p( \
+ ::boost::container::allocator_traits< \
+ typename traits::allocator \
+ >::allocate(this->_allocator, 1) \
+ ); \
+ ::boost::container::allocator_traits< \
+ typename traits::allocator \
+ >::construct( \
+ this->_allocator \
+ , p \
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_FORWARD \
+ , _ \
+ ) \
+ ); \
+ p->_add_child(p->_right_child = this->_right_child); \
+ this->_right_child = ::boost::initialized_value; \
+ this->on_post_erase(); \
+ return this->_add_child(this->_right_child = p); \
+ } \
+ else \
+ { \
+ ::boost::container::allocator_traits< \
+ typename traits::allocator \
+ >::construct( \
+ this->_allocator \
+ , this->_right_child = ::boost::container::allocator_traits< \
+ typename traits::allocator \
+ >::allocate(this->_allocator, 1) \
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_FORWARD \
+ , _ \
+ ) \
+ ); \
+ return this->_add_child(this->_right_child); \
+ } \
+ } \
+//!
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_BINARY_NODE_MACRO
+ , _
+ )
+#undef BOOST_TREE_NODE_BINARY_NODE_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<Derived,T,Size,Allocator>::const_pointer
+ binary_node_base<Derived,T,Size,Allocator>::get_left_child_ptr() const
+ {
+ return this->_left_child;
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<Derived,T,Size,Allocator>::pointer
+ binary_node_base<Derived,T,Size,Allocator>::get_left_child_ptr()
+ {
+ return this->_left_child;
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<Derived,T,Size,Allocator>::const_pointer
+ binary_node_base<Derived,T,Size,Allocator>::get_right_child_ptr() const
+ {
+ return this->_right_child;
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<Derived,T,Size,Allocator>::pointer
+ binary_node_base<Derived,T,Size,Allocator>::get_right_child_ptr()
+ {
+ return this->_right_child;
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<Derived,T,Size,Allocator>::const_iterator
+ binary_node_base<Derived,T,Size,Allocator>::cbegin() const
+ {
+ return const_iterator(this->get_derived(), false);
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<Derived,T,Size,Allocator>::const_iterator
+ binary_node_base<Derived,T,Size,Allocator>::begin() const
+ {
+ return const_iterator(this->get_derived(), false);
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<Derived,T,Size,Allocator>::iterator
+ binary_node_base<Derived,T,Size,Allocator>::begin()
+ {
+ return iterator(this->get_derived(), false);
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<Derived,T,Size,Allocator>::const_iterator
+ binary_node_base<Derived,T,Size,Allocator>::cend() const
+ {
+ return const_iterator(this->get_derived());
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<Derived,T,Size,Allocator>::const_iterator
+ binary_node_base<Derived,T,Size,Allocator>::end() const
+ {
+ return const_iterator(this->get_derived());
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<Derived,T,Size,Allocator>::iterator
+ binary_node_base<Derived,T,Size,Allocator>::end()
+ {
+ return iterator(this->get_derived());
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<
+ Derived
+ , T
+ , Size
+ , Allocator
+ >::const_reverse_iterator
+ binary_node_base<Derived,T,Size,Allocator>::crbegin() const
+ {
+ return const_reverse_iterator(this->get_derived(), false);
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<
+ Derived
+ , T
+ , Size
+ , Allocator
+ >::const_reverse_iterator
+ binary_node_base<Derived,T,Size,Allocator>::rbegin() const
+ {
+ return const_reverse_iterator(this->get_derived(), false);
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<
+ Derived
+ , T
+ , Size
+ , Allocator
+ >::reverse_iterator
+ binary_node_base<Derived,T,Size,Allocator>::rbegin()
+ {
+ return reverse_iterator(this->get_derived(), false);
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<
+ Derived
+ , T
+ , Size
+ , Allocator
+ >::const_reverse_iterator
+ binary_node_base<Derived,T,Size,Allocator>::crend() const
+ {
+ return const_reverse_iterator(this->get_derived());
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<
+ Derived
+ , T
+ , Size
+ , Allocator
+ >::const_reverse_iterator
+ binary_node_base<Derived,T,Size,Allocator>::rend() const
+ {
+ return const_reverse_iterator(this->get_derived());
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<
+ Derived
+ , T
+ , Size
+ , Allocator
+ >::reverse_iterator
+ binary_node_base<Derived,T,Size,Allocator>::rend()
+ {
+ return reverse_iterator(this->get_derived());
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<Derived,T,Size,Allocator>::size_type
+ binary_node_base<Derived,T,Size,Allocator>::size() const
+ {
+ return (
+ this->_left_child
+ ? (this->_right_child ? 2 : 1)
+ : (this->_right_child ? 1 : 0)
+ );
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline bool binary_node_base<Derived,T,Size,Allocator>::empty() const
+ {
+ return !this->_left_child && !this->_right_child;
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline void binary_node_base<Derived,T,Size,Allocator>::clear()
+ {
+ if (this->_left_child)
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ this->_allocator.destroy(this->_left_child);
+ this->_allocator.deallocate(this->_left_child, 1);
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::destroy(this->_allocator, this->_left_child);
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::deallocate(this->_allocator, this->_left_child, 1);
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ }
+
+ if (this->_right_child)
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ this->_allocator.destroy(this->_right_child);
+ this->_allocator.deallocate(this->_right_child, 1);
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::destroy(this->_allocator, this->_right_child);
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::deallocate(this->_allocator, this->_right_child, 1);
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ }
+
+ this->_left_child = this->_right_child = ::boost::initialized_value;
+ this->on_post_clear();
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<Derived,T,Size,Allocator>::pointer
+ binary_node_base<Derived,T,Size,Allocator>::rotate_left()
+ {
+ pointer pivot = this->_right_child;
+
+ pivot->_parent = this->_parent;
+
+ if ((this->_right_child = pivot->_left_child))
+ {
+ this->_right_child->_parent = this->get_derived();
+ }
+
+ pivot->_left_child = this->get_derived();
+
+ if (this->_parent)
+ {
+ if (this->_parent->_left_child == this->get_derived())
+ {
+ this->_parent->_left_child = pivot;
+ }
+ else // if (this->_parent->_right_child == this->get_derived())
+ {
+ this->_parent->_right_child = pivot;
+ }
+ }
+
+ this->_parent = pivot;
+ this->on_post_rotate_left();
+ return pivot;
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<Derived,T,Size,Allocator>::pointer
+ binary_node_base<Derived,T,Size,Allocator>::rotate_right()
+ {
+ pointer pivot = this->_left_child;
+
+ pivot->_parent = this->_parent;
+
+ if ((this->_left_child = pivot->_right_child))
+ {
+ this->_left_child->_parent = this->get_derived();
+ }
+
+ pivot->_right_child = this->get_derived();
+
+ if (this->_parent)
+ {
+ if (this->_parent->_right_child == this->get_derived())
+ {
+ this->_parent->_right_child = pivot;
+ }
+ else // if (this->_parent->_left_child == this->get_derived())
+ {
+ this->_parent->_left_child = pivot;
+ }
+ }
+
+ this->_parent = pivot;
+ this->on_post_rotate_right();
+ return pivot;
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline bool binary_node_base<Derived,T,Size,Allocator>::erase_left()
+ {
+ if (this->_left_child)
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ this->_allocator.destroy(this->_left_child);
+ this->_allocator.deallocate(this->_left_child, 1);
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::destroy(this->_allocator, this->_left_child);
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::deallocate(this->_allocator, this->_left_child, 1);
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ this->_left_child = ::boost::initialized_value;
+ this->on_post_erase();
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline bool binary_node_base<Derived,T,Size,Allocator>::erase_right()
+ {
+ if (this->_right_child)
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ this->_allocator.destroy(this->_right_child);
+ this->_allocator.deallocate(this->_right_child, 1);
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::destroy(this->_allocator, this->_right_child);
+ ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::deallocate(this->_allocator, this->_right_child, 1);
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ this->_right_child = ::boost::initialized_value;
+ this->on_post_erase();
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<
+ Derived
+ , T
+ , Size
+ , Allocator
+ >::traits::allocator_reference
+ binary_node_base<Derived,T,Size,Allocator>::_construct_from(
+ typename traits::allocator_reference allocator
+ , ::std::tr1::true_type
+ )
+ {
+ return allocator;
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline Allocator
+ binary_node_base<Derived,T,Size,Allocator>::_construct_from(
+ typename traits::allocator_reference allocator
+ , ::std::tr1::false_type
+ )
+ {
+ return ::boost::container::allocator_traits<
+ typename traits::allocator
+ >::select_on_container_copy_construction(allocator);
+ }
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ typename binary_node_base<Derived,T,Size,Allocator>::iterator
+ binary_node_base<Derived,T,Size,Allocator>::_add_child(
+ pointer const& child
+ )
+ {
+ child->_parent = this->get_derived();
+ iterator result(child, true);
+ result->on_post_inserted(result, ::boost::mpl::true_());
+ return result;
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline void
+ binary_node_base<Derived,T,Size,Allocator>::_link_children_to_parent()
+ {
+ if (this->_left_child)
+ {
+ this->_left_child->_parent = this->get_derived();
+ }
+
+ if (this->_right_child)
+ {
+ this->_right_child->_parent = this->get_derived();
+ }
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline void
+ binary_node_base<Derived,T,Size,Allocator>::_on_post_modify_value(
+ data_key const& key
+ )
+ {
+ this->on_post_propagate_value(key);
+ }
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ template <typename FusionKey>
+ inline void
+ binary_node_base<Derived,T,Size,Allocator>::_on_post_modify_value(
+ FusionKey const& key
+ )
+ {
+ this->on_post_propagate_value(key);
+ }
+#endif
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline void
+ binary_node_base<Derived,T,Size,Allocator>::_set_parent_ptr(pointer p)
+ {
+ if (this->_parent)
+ {
+ if (this->get_derived() == this->_parent->_left_child)
+ {
+ this->_parent->_left_child = ::boost::initialized_value;
+ }
+ else // if (this->get_derived() == this->_parent->_right_child)
+ {
+ this->_parent->_right_child = ::boost::initialized_value;
+ }
+
+ this->_parent->on_post_erase();
+ }
+
+ if ((this->_parent = p))
+ {
+ this->on_post_inserted(
+ iterator(this->get_derived(), true)
+ , ::boost::mpl::true_()
+ );
+ }
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline void
+ binary_node_base<Derived,T,Size,Allocator>::_set_left_child_ptr(
+ pointer p
+ )
+ {
+ if (this->_left_child)
+ {
+ this->_left_child = ::boost::initialized_value;
+ this->on_post_erase();
+ }
+
+ if ((this->_left_child = p))
+ {
+ p->_parent = this->get_derived();
+ p->on_post_inserted(iterator(p, true), ::boost::mpl::true_());
+ }
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline void
+ binary_node_base<Derived,T,Size,Allocator>::_set_right_child_ptr(
+ pointer p
+ )
+ {
+ if (this->_right_child)
+ {
+ this->_right_child = ::boost::initialized_value;
+ this->on_post_erase();
+ }
+
+ if ((this->_right_child = p))
+ {
+ p->_parent = this->get_derived();
+ p->on_post_inserted(iterator(p, true), ::boost::mpl::true_());
+ }
+ }
+}} // namespace boost::tree_node
+
+namespace boost { namespace tree_node {
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<
+ Derived
+ , T
+ , Size
+ , Allocator
+ >::traits::data_type const&
+ get(
+ binary_node_base<Derived,T,Size,Allocator> const& node
+ , data_key const& key
+ )
+ {
+ return node[key];
+ }
+
+ template <typename Derived, typename T, typename Size, typename Allocator>
+ inline typename binary_node_base<
+ Derived
+ , T
+ , Size
+ , Allocator
+ >::traits::data_type&
+ get(
+ binary_node_base<Derived,T,Size,Allocator>& node
+ , data_key const& key
+ )
+ {
+ return node[key];
+ }
+
+#if !defined BOOST_NO_SFINAE
+ template <
+ typename Key
+ , typename Derived
+ , typename T
+ , typename Size
+ , typename Allocator
+ >
+ inline typename ::boost::enable_if<
+ ::std::tr1::is_same<Key,data_key>
+ , typename binary_node_base<
+ Derived
+ , T
+ , Size
+ , Allocator
+ >::traits::data_type const&
+ >::type
+ get(binary_node_base<Derived,T,Size,Allocator> const& node)
+ {
+ return node[data_key()];
+ }
+
+ template <
+ typename Key
+ , typename Derived
+ , typename T
+ , typename Size
+ , typename Allocator
+ >
+ inline typename ::boost::enable_if<
+ ::std::tr1::is_same<Key,data_key>
+ , typename binary_node_base<Derived,T,Size,Allocator>::traits::data_type&
+ >::type
+ get(binary_node_base<Derived,T,Size,Allocator>& node)
+ {
+ return node[data_key()];
+ }
+#endif // BOOST_NO_SFINAE
+
+ template <
+ typename Derived
+ , typename T
+ , typename Size
+ , typename Allocator
+ , typename V
+ >
+ inline void
+ put(
+ binary_node_base<Derived,T,Size,Allocator>& node
+ , data_key const& key
+ , V const& value
+ )
+ {
+ node[key] = value;
+ node._on_post_modify_value(key);
+ }
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ template <
+ typename Derived
+ , typename T
+ , typename Size
+ , typename Allocator
+ , typename FusionKey
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ binary_node_base<Derived,T,Size,Allocator>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<T const,FusionKey>
+ >::type
+ get(
+ binary_node_base<Derived,T,Size,Allocator> const& node
+ , FusionKey const& key
+ )
+ {
+ return node[key];
+ }
+
+ template <
+ typename Derived
+ , typename T
+ , typename Size
+ , typename Allocator
+ , typename FusionKey
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ binary_node_base<Derived,T,Size,Allocator>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<T,FusionKey>
+ >::type
+ get(
+ binary_node_base<Derived,T,Size,Allocator>& node
+ , FusionKey const& key
+ )
+ {
+ return node[key];
+ }
+
+ template <
+ typename Derived
+ , typename T
+ , typename Size
+ , typename Allocator
+ , typename FusionKey
+ , typename V
+ >
+ inline void
+ put(
+ binary_node_base<Derived,T,Size,Allocator>& node
+ , FusionKey const& key
+ , V const& value
+ , typename ::boost::enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ binary_node_base<Derived,T,Size,Allocator>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::mpl::true_
+ >::type
+ )
+ {
+ node[key] = value;
+ node._on_post_modify_value(key);
+ }
+
+ template <
+ typename FusionKey
+ , typename Derived
+ , typename T
+ , typename Size
+ , typename Allocator
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ binary_node_base<Derived,T,Size,Allocator>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<T const,FusionKey>
+ >::type
+ get(binary_node_base<Derived,T,Size,Allocator> const& node)
+ {
+ return node[FusionKey()];
+ }
+
+ template <
+ typename FusionKey
+ , typename Derived
+ , typename T
+ , typename Size
+ , typename Allocator
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ binary_node_base<Derived,T,Size,Allocator>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<T,FusionKey>
+ >::type
+ get(binary_node_base<Derived,T,Size,Allocator>& node)
+ {
+ return node[FusionKey()];
+ }
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+}} // namespace boost::tree_node
+
+//[reference__binary_node_base_gen
+namespace boost { namespace tree_node {
+
+ template <
+ typename Size = ::boost::uint32_t
+ , typename AllocatorSelector = ::boost::std_allocator_selector
+ >
+ struct binary_node_base_gen
+ {
+ template <typename Derived, typename T>
+ struct apply
+ {
+ typedef binary_node_base<
+ Derived
+ , T
+ , Size
+ , typename ::boost::mpl::apply_wrap1<
+ AllocatorSelector
+ , Derived
+ >::type
+ >
+ type;
+ };
+ };
+
+ typedef binary_node_base_gen<> binary_node_base_default_gen;
+}} // namespace boost::tree_node
+//]
+
+namespace boost { namespace tree_node {
+
+ template <typename T, typename Size, typename AllocatorSelector>
+ struct binary_node
+ : public
+ //[reference__binary_node__bases
+ binary_node_base<
+ binary_node<T,Size,AllocatorSelector>
+ , T
+ , Size
+ , typename ::boost::mpl::apply_wrap1<
+ AllocatorSelector
+ , binary_node<T,Size,AllocatorSelector>
+ >::type
+ >
+ //]
+ {
+ //[reference__binary_node__super_t
+ typedef binary_node_base<
+ binary_node
+ , T
+ , Size
+ , typename ::boost::mpl::apply_wrap1<
+ AllocatorSelector
+ , binary_node
+ >::type
+ >
+ super_t;
+ //]
+
+ //[reference__binary_node__traits
+ typedef typename super_t::traits
+ traits;
+ //]
+
+ //[reference__binary_node__pointer
+ typedef typename super_t::pointer
+ pointer;
+ //]
+
+ //[reference__binary_node__const_pointer
+ typedef typename super_t::const_pointer
+ const_pointer;
+ //]
+
+ //[reference__binary_node__iterator
+ typedef typename super_t::iterator
+ iterator;
+ //]
+
+ //[reference__binary_node__const_iterator
+ typedef typename super_t::const_iterator
+ const_iterator;
+ //]
+
+ //[reference__binary_node__reverse_iterator
+ typedef typename super_t::reverse_iterator
+ reverse_iterator;
+ //]
+
+ //[reference__binary_node__const_reverse_iterator
+ typedef typename super_t::const_reverse_iterator
+ const_reverse_iterator;
+ //]
+
+ //[reference__binary_node__size_type
+ typedef typename super_t::size_type
+ size_type;
+ //]
+
+ BOOST_TREE_NODE_COPYABLE_AND_MOVABLE(binary_node, super_t)
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ //[reference__binary_node__emplacement_ctor
+ template <typename ...Args>
+ explicit binary_node(Args&& ...args);
+ //]
+
+ //[reference__binary_node__emplacement_ctor_w_allocator
+ template <typename ...Args>
+ explicit binary_node(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ );
+ //]
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_INLINE_DEF
+ , (binary_node, super_t)
+ )
+
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_W_ALLOC_INLINE_DEF
+ , (binary_node, super_t)
+ )
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+ };
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <typename T, typename Size, typename AllocatorSelector>
+ template <typename ...Args>
+ inline binary_node<T,Size,AllocatorSelector>::binary_node(Args&& ...args)
+ : super_t(::boost::forward<Args>(args)...)
+ {
+ }
+
+ template <typename T, typename Size, typename AllocatorSelector>
+ template <typename ...Args>
+ inline binary_node<T,Size,AllocatorSelector>::binary_node(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ ) : super_t(
+ ::boost::container::allocator_arg
+ , allocator
+ , ::boost::forward<Args>(args)...
+ )
+ {
+ }
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+}} // namespace boost::tree_node
+
+//[reference__binary_node_gen
+namespace boost { namespace tree_node {
+
+ template <
+ typename Size = ::boost::uint32_t
+ , typename AllocatorSelector = ::boost::std_allocator_selector
+ >
+ struct binary_node_gen
+ {
+ template <typename T>
+ struct apply
+ {
+ typedef binary_node<T,Size,AllocatorSelector> type;
+ };
+ };
+
+ typedef binary_node_gen<> binary_node_default_gen;
+}} // namespace boost::tree_node
+//]
+
+#include <boost/tree_node/_detail/config_end.hpp>
+
+#endif // BOOST_TREE_NODE_BINARY_NODE_HPP_INCLUDED
+

Added: sandbox/tree_node/boost/tree_node/nary_node.hpp
==============================================================================
--- (empty file)
+++ sandbox/tree_node/boost/tree_node/nary_node.hpp 2013-03-11 00:49:15 EDT (Mon, 11 Mar 2013)
@@ -0,0 +1,1481 @@
+// Copyright (C) 2011-2013 Cromwell D. Enage
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_TREE_NODE_NARY_NODE_HPP_INCLUDED
+#define BOOST_TREE_NODE_NARY_NODE_HPP_INCLUDED
+
+#include <utility>
+#include <boost/mpl/assert.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/iterator/transform_iterator.hpp>
+#include <boost/range.hpp>
+#include <boost/container_gen/container_gen.hpp>
+#include <boost/container_gen/emplace_function_gen.hpp>
+#include <boost/container_gen/insert_range_result_gen.hpp>
+#include <boost/container_gen/is_recursive_selector.hpp>
+#include <boost/container_gen/has_stable_iters_selector.hpp>
+#include <boost/tree_node/preprocessor.hpp>
+#include <boost/tree_node/base.hpp>
+#include <boost/tree_node/nary_node_fwd.hpp>
+#include <boost/tree_node/intrinsic/has_key.hpp>
+#include <boost/tree_node/intrinsic/get_keys.hpp>
+#include <boost/detail/metafunction/container_reverse_iterator.hpp>
+#include <boost/assert.hpp>
+
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/container_gen/insert_range_function_gen.hpp>
+#else
+#include <boost/move/move.hpp>
+#include <boost/container_gen/splice_function_gen.hpp>
+#endif
+
+#if !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#include <boost/preprocessor/repetition/enum_trailing.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#endif
+
+#include <boost/tree_node/_detail/config_begin.hpp>
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/type_traits/is_pod.hpp>
+
+namespace boost {
+
+ template <typename Derived, typename T, typename Selector>
+ struct is_POD<
+ ::boost::tree_node::nary_node_base<Derived,T,Selector>
+ > : ::boost::false_type
+ {
+ };
+
+ template <typename Derived, typename T, typename Selector>
+ struct is_pod<
+ ::boost::tree_node::nary_node_base<Derived,T,Selector>
+ > : ::boost::false_type
+ {
+ };
+} // namespace boost
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/placeholders.hpp>
+#include <boost/mpl/transform_view.hpp>
+#include <boost/fusion/sequence/intrinsic/at_key.hpp>
+#include <boost/fusion/iterator/key_of.hpp>
+#include <boost/fusion/support/is_sequence.hpp>
+#include <boost/fusion/support/category_of.hpp>
+
+namespace boost { namespace tree_node { namespace result_of {
+
+ template <
+ typename Derived
+ , typename T
+ , typename Selector
+ , typename FusionKey
+ >
+ struct has_key_impl<nary_node_base<Derived,T,Selector>,FusionKey>
+ : ::boost::mpl::eval_if<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::has_key<T,FusionKey>
+ , ::std::tr1::is_same<FusionKey,data_key>
+ >::type
+ {
+ };
+
+ template <typename Derived, typename T, typename Selector>
+ struct get_keys_impl<nary_node_base<Derived,T,Selector> >
+ : ::boost::mpl::eval_if<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::mpl::transform_view<
+ T
+ , ::boost::fusion::result_of::key_of< ::boost::mpl::_>
+ >
+ , ::boost::mpl::vector1<data_key>
+ >
+ {
+ };
+}}} // namespace boost::tree_node::result_of
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+
+namespace boost { namespace tree_node {
+
+ template <typename Derived, typename T, typename Selector>
+ class nary_node_base
+ : public
+ //[reference__nary_node_base__bases
+ tree_node_base<Derived>
+ //]
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ , public data_key
+#endif
+ , private ::boost::noncopyable
+ {
+ BOOST_MPL_ASSERT((::boost::is_recursive_selector<Selector>));
+
+ //[reference__nary_node_base__children
+ typedef typename ::boost::container_gen<Selector,Derived>::type
+ children;
+ //]
+
+ public:
+ //[reference__nary_node_base__super_t
+ typedef tree_node_base<Derived>
+ super_t;
+ //]
+
+ //[reference__nary_node_base__traits
+ struct traits
+ {
+ typedef T data_type;
+ typedef typename children::allocator_type allocator;
+ typedef allocator const& allocator_reference;
+ };
+ //]
+
+ //[reference__nary_node_base__pointer
+ typedef typename super_t::pointer
+ pointer;
+ //]
+
+ //[reference__nary_node_base__const_pointer
+ typedef typename super_t::const_pointer
+ const_pointer;
+ //]
+
+ //[reference__nary_node_base__iterator
+ typedef typename children::iterator
+ iterator;
+ //]
+
+ //[reference__nary_node_base__const_iterator
+ typedef typename children::const_iterator
+ const_iterator;
+ //]
+
+ //[reference__nary_node_base__reverse_iterator
+ typedef // typename children::reverse_iterator
+ //<-
+ typename ::boost::detail::metafunction
+ ::container_reverse_iterator<children>::type
+ //->
+ reverse_iterator;
+ //]
+
+ //[reference__nary_node_base__const_reverse_iterator
+ typedef // typename children::const_reverse_iterator
+ //<-
+ typename ::boost::detail::metafunction
+ ::container_reverse_iterator<children const>::type
+ //->
+ const_reverse_iterator;
+ //]
+
+ //[reference__nary_node_base__size_type
+ typedef typename children::size_type
+ size_type;
+ //]
+
+ private:
+ children _children;
+ typename traits::data_type _data;
+ pointer _parent;
+
+ protected:
+ //[reference__nary_node_base__derived_copy_ctor
+ nary_node_base(Derived const& copy);
+ //]
+
+ //[reference__nary_node_base__derived_copy_ctor_w_allocator
+ nary_node_base(
+ Derived const& copy
+ , typename traits::allocator_reference allocator
+ );
+ //]
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ nary_node_base(BOOST_RV_REF(Derived) source);
+
+ nary_node_base(
+ BOOST_RV_REF(Derived) source
+ , typename traits::allocator_reference allocator
+ );
+#endif
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ //[reference__nary_node_base__emplacement_ctor
+ template <typename ...Args>
+ explicit nary_node_base(Args&& ...args);
+ //]
+
+ //[reference__nary_node_base__emplacement_ctor_w_allocator
+ template <typename ...Args>
+ explicit nary_node_base(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ );
+ //]
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_FWD_DECL
+ , nary_node_base
+ )
+
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_W_ALLOC_FWD_DECL
+ , nary_node_base
+ )
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ ~nary_node_base();
+
+ //[reference__nary_node_base__on_post_copy_or_move
+ void on_post_copy_or_move();
+ //]
+
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ //[reference__nary_node_base__copy_assign
+ void copy_assign(Derived const& copy);
+ //]
+#else
+ void copy_assign(BOOST_COPY_ASSIGN_REF(Derived) copy);
+
+ void move_assign(BOOST_RV_REF(Derived) source);
+#endif
+
+ public:
+ //[reference__nary_node_base__data_key_value_operator__const
+ typename traits::data_type const& operator[](data_key const&) const;
+ //]
+
+ //[reference__nary_node_base__data_key_value_operator
+ typename traits::data_type& operator[](data_key const&);
+ //]
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ //[reference__nary_node_base__key_value_operator__const
+ template <typename FusionKey>
+ typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ nary_node_base<Derived,T,Selector>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<T const,FusionKey>
+ >::type
+ operator[](FusionKey const&) const;
+ //]
+
+ //[reference__nary_node_base__key_value_operator
+ template <typename FusionKey>
+ typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ nary_node_base<Derived,T,Selector>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<T,FusionKey>
+ >::type
+ operator[](FusionKey const&);
+ //]
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+
+ //[reference__nary_node_base__get_parent_ptr__const
+ const_pointer get_parent_ptr() const;
+ //]
+
+ //[reference__nary_node_base__get_parent_ptr
+ pointer get_parent_ptr();
+ //]
+
+ //[reference__nary_node_base__insert
+ iterator insert(Derived const& child);
+ //]
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ //[reference__nary_node_base__emplace
+ template <typename ...Args>
+ iterator emplace(Args&& ...args);
+ //]
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#define BOOST_TREE_NODE_NARY_NODE_MACRO(z, n, _) \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ iterator \
+ emplace( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ); \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_NARY_NODE_MACRO
+ , _
+ )
+#undef BOOST_TREE_NODE_NARY_NODE_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ //[reference__nary_node_base__splice
+ typename ::boost::insert_range_result_gen<Selector,Derived>::type
+ splice(iterator pos, Derived& node);
+
+ iterator splice(iterator pos, Derived& node, iterator itr);
+
+ typename ::boost::insert_range_result_gen<Selector,Derived>::type
+ splice(
+ iterator pos
+ , Derived& node
+ , iterator itr
+ , iterator itr_end
+ );
+ //]
+
+ //[reference__nary_node_base__cbegin
+ const_iterator cbegin() const;
+ const_iterator begin() const;
+ //]
+
+ //[reference__nary_node_base__begin
+ iterator begin();
+ //]
+
+ //[reference__nary_node_base__cend
+ const_iterator cend() const;
+ const_iterator end() const;
+ //]
+
+ //[reference__nary_node_base__end
+ iterator end();
+ //]
+
+ //[reference__nary_node_base__crbegin
+ const_reverse_iterator crbegin() const;
+ const_reverse_iterator rbegin() const;
+ //]
+
+ //[reference__nary_node_base__rbegin
+ reverse_iterator rbegin();
+ //]
+
+ //[reference__nary_node_base__crend
+ const_reverse_iterator crend() const;
+ const_reverse_iterator rend() const;
+ //]
+
+ //[reference__nary_node_base__rend
+ reverse_iterator rend();
+ //]
+
+ //[reference__nary_node_base__size
+ size_type size() const;
+ //]
+
+ //[reference__nary_node_base__empty
+ bool empty() const;
+ //]
+
+ //[reference__nary_node_base__clear
+ void clear();
+ //]
+
+ private:
+ static void
+ _link_children_to_parent(
+ pointer const& p
+ , iterator itr
+ , iterator itr_end
+ );
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <typename ...Args>
+ iterator _add_child(Args&& ...args);
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#define BOOST_TREE_NODE_NARY_NODE_MACRO(z, n, _) \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ iterator \
+ _add_child( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ); \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_NARY_NODE_MACRO
+ , _
+ )
+#undef BOOST_TREE_NODE_NARY_NODE_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ void _initialize(iterator& to_child);
+
+ void _on_post_modify_value(data_key const& key);
+
+ template <typename D, typename T0, typename S, typename V>
+ friend void
+ put(
+ nary_node_base<D,T0,S>& node
+ , data_key const& key
+ , V const& value
+ );
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ template <typename FusionKey>
+ void _on_post_modify_value(FusionKey const& key);
+
+ template <
+ typename D
+ , typename T0
+ , typename S
+ , typename FusionKey
+ , typename V
+ >
+ friend void
+ put(
+ nary_node_base<D,T0,S>& node
+ , FusionKey const& key
+ , V const& value
+ , typename ::boost::enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T0>::type
+ , ::boost::fusion::traits::is_associative<T0>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<nary_node_base<D,T0,S>,FusionKey>
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::mpl::true_
+ >::type
+ );
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+ };
+
+ template <typename Derived, typename T, typename Selector>
+ nary_node_base<Derived,T,Selector>::nary_node_base(Derived const& copy)
+ : _children(copy._children)
+ , _data(copy._data)
+ , _parent(copy._parent)
+ {
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ nary_node_base<Derived,T,Selector>::nary_node_base(
+ Derived const& copy
+ , typename traits::allocator_reference allocator
+ ) : _children(copy._children, allocator)
+ , _data(copy._data)
+ , _parent(copy._parent)
+ {
+ }
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <typename Derived, typename T, typename Selector>
+ nary_node_base<Derived,T,Selector>::nary_node_base(
+ BOOST_RV_REF(Derived) source
+ ) : _children(::boost::move(source._children))
+ , _data(::boost::move(source._data))
+ , _parent(source._parent)
+ {
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ nary_node_base<Derived,T,Selector>::nary_node_base(
+ BOOST_RV_REF(Derived) source
+ , typename traits::allocator_reference allocator
+ ) : _children(::boost::move(source._children), allocator)
+ , _data(::boost::move(source._data))
+ , _parent(source._parent)
+ {
+ }
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <typename Derived, typename T, typename Selector>
+ template <typename ...Args>
+ nary_node_base<Derived,T,Selector>::nary_node_base(Args&& ...args)
+ : _children(), _data(::boost::forward<Args>(args)...), _parent()
+ {
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ template <typename ...Args>
+ nary_node_base<Derived,T,Selector>::nary_node_base(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ ) : _children(allocator), _data(::boost::forward<Args>(args)...), _parent()
+ {
+ }
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#define BOOST_TREE_NODE_NARY_NODE_MACRO(z, n, _) \
+ template <typename Derived, typename T, typename Selector> \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ nary_node_base<Derived,T,Selector>::nary_node_base( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ) : _children() \
+ , _data( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_FORWARD \
+ , _ \
+ ) \
+ ) \
+ , _parent() \
+ { \
+ } \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_NARY_NODE_MACRO
+ , _
+ )
+#undef BOOST_TREE_NODE_NARY_NODE_MACRO
+
+#define BOOST_TREE_NODE_NARY_NODE_MACRO(z, n, _) \
+ template <typename Derived, typename T, typename Selector> \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ nary_node_base<Derived,T,Selector>::nary_node_base( \
+ ::boost::container::allocator_arg_t \
+ , typename traits::allocator_reference allocator \
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ) : _children(allocator) \
+ , _data( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_FORWARD \
+ , _ \
+ ) \
+ ) \
+ , _parent() \
+ { \
+ } \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_NARY_NODE_MACRO
+ , _
+ )
+#undef BOOST_TREE_NODE_NARY_NODE_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ template <typename Derived, typename T, typename Selector>
+ nary_node_base<Derived,T,Selector>::~nary_node_base()
+ {
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline void nary_node_base<Derived,T,Selector>::on_post_copy_or_move()
+ {
+ nary_node_base<Derived,T,Selector>::_link_children_to_parent(
+ this->get_derived()
+ , this->_children.begin()
+ , this->_children.end()
+ );
+ this->on_post_propagate_value(data_key());
+ }
+
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <typename Derived, typename T, typename Selector>
+ void nary_node_base<Derived,T,Selector>::copy_assign(Derived const& copy)
+ {
+ Derived twin(copy);
+
+ this->_children = twin._children;
+ this->_data = twin._data;
+ }
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <typename Derived, typename T, typename Selector>
+ void
+ nary_node_base<Derived,T,Selector>::copy_assign(
+ BOOST_COPY_ASSIGN_REF(Derived) copy
+ )
+ {
+ Derived twin(static_cast<Derived const&>(copy));
+
+ this->_children = ::boost::move(twin._children);
+ this->_data = ::boost::move(twin._data);
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline void
+ nary_node_base<Derived,T,Selector>::move_assign(
+ BOOST_RV_REF(Derived) source
+ )
+ {
+ this->_children = ::boost::move(source._children);
+ this->_data = ::boost::move(source._data);
+ }
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<
+ Derived
+ , T
+ , Selector
+ >::traits::data_type const&
+ nary_node_base<Derived,T,Selector>::operator[](data_key const&) const
+ {
+ return this->_data;
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<Derived,T,Selector>::traits::data_type&
+ nary_node_base<Derived,T,Selector>::operator[](data_key const&)
+ {
+ return this->_data;
+ }
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ template <typename Derived, typename T, typename Selector>
+ template <typename FusionKey>
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ nary_node_base<Derived,T,Selector>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<T const,FusionKey>
+ >::type
+ nary_node_base<Derived,T,Selector>::operator[](FusionKey const&) const
+ {
+ return ::boost::fusion::at_key<FusionKey>(this->_data);
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ template <typename FusionKey>
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ nary_node_base<Derived,T,Selector>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<T,FusionKey>
+ >::type
+ nary_node_base<Derived,T,Selector>::operator[](FusionKey const&)
+ {
+ return ::boost::fusion::at_key<FusionKey>(this->_data);
+ }
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<Derived,T,Selector>::const_pointer
+ nary_node_base<Derived,T,Selector>::get_parent_ptr() const
+ {
+ return this->_parent;
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<Derived,T,Selector>::pointer
+ nary_node_base<Derived,T,Selector>::get_parent_ptr()
+ {
+ return this->_parent;
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<Derived,T,Selector>::iterator
+ nary_node_base<Derived,T,Selector>::insert(Derived const& child)
+ {
+#if defined BOOST_MSVC
+ Derived twin(child);
+ iterator result(this->_add_child(twin));
+#else
+ iterator result(this->_add_child(Derived(child)));
+#endif
+ BOOST_ASSERT((*result)._parent == this->get_derived());
+ return result;
+ }
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <typename Derived, typename T, typename Selector>
+ template <typename ...Args>
+ inline typename nary_node_base<Derived,T,Selector>::iterator
+ nary_node_base<Derived,T,Selector>::emplace(Args&& ...args)
+ {
+ iterator result(this->_add_child(::boost::forward<Args>(args)...));
+ BOOST_ASSERT((*result)._parent == this->get_derived());
+ return result;
+ }
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#define BOOST_TREE_NODE_NARY_NODE_MACRO(z, n, _) \
+ template <typename Derived, typename T, typename Selector> \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ inline typename nary_node_base<Derived,T,Selector>::iterator \
+ nary_node_base<Derived,T,Selector>::emplace( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ) \
+ { \
+ iterator result = this->_add_child( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_FORWARD \
+ , _ \
+ ) \
+ ); \
+ BOOST_ASSERT((*result)._parent == this->get_derived()); \
+ return result; \
+ } \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_NARY_NODE_MACRO
+ , _
+ )
+#undef BOOST_TREE_NODE_NARY_NODE_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ template <typename Derived, typename T, typename Selector>
+ typename ::boost::insert_range_result_gen<Selector,Derived>::type
+ nary_node_base<Derived,T,Selector>::splice(iterator pos, Derived& node)
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ typename ::boost::insert_range_function_gen<Selector>::type
+ range_pusher;
+ typename ::boost::insert_range_result_gen<Selector,Derived>::type
+ result = range_pusher(
+ this->_children
+ , pos
+ , node.begin()
+ , node.end()
+ );
+
+ node.clear();
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ typename ::boost::splice_function_gen<Selector>::type
+ splicer;
+ typename ::boost::insert_range_result_gen<Selector,Derived>::type
+ result = splicer(
+ this->_children
+ , pos
+ , node._children
+ , node.begin()
+ , node.end()
+ );
+
+ node.on_post_clear();
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ nary_node_base<Derived,T,Selector>::_link_children_to_parent(
+ this->get_derived()
+ , ::boost::begin(result)
+ , ::boost::end(result)
+ );
+ this->on_post_insert(
+ ::boost::begin(result)
+ , ::boost::end(result)
+ , ::boost::has_stable_iterators_selector<Selector>()
+ );
+ return result;
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ typename nary_node_base<Derived,T,Selector>::iterator
+ nary_node_base<Derived,T,Selector>::splice(
+ iterator pos
+ , Derived& node
+ , iterator itr
+ )
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ iterator result = node._children.insert(pos, *itr);
+
+ node._children.erase(itr);
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ typename ::boost::splice_function_gen<Selector>::type
+ splicer;
+ iterator result = splicer(
+ this->_children
+ , pos
+ , node._children
+ , itr
+ );
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ node.on_post_erase();
+ (*result)._parent = this->get_derived();
+ (*result).on_post_inserted(
+ result
+ , ::boost::has_stable_iterators_selector<Selector>()
+ );
+ return result;
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ typename ::boost::insert_range_result_gen<Selector,Derived>::type
+ nary_node_base<Derived,T,Selector>::splice(
+ iterator pos
+ , Derived& node
+ , iterator itr
+ , iterator itr_end
+ )
+ {
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ typename ::boost::insert_range_function_gen<Selector>::type
+ range_pusher;
+ typename ::boost::insert_range_result_gen<Selector,Derived>::type
+ result = range_pusher(
+ this->_children
+ , pos
+ , itr
+ , itr_end
+ );
+
+ node._children.erase(itr, itr_end);
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ typename ::boost::splice_function_gen<Selector>::type
+ splicer;
+ typename ::boost::insert_range_result_gen<Selector,Derived>::type
+ result = splicer(
+ this->_children
+ , pos
+ , node._children
+ , itr
+ , itr_end
+ );
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ node.on_post_erase();
+ nary_node_base<Derived,T,Selector>::_link_children_to_parent(
+ this->get_derived()
+ , ::boost::begin(result)
+ , ::boost::end(result)
+ );
+ this->on_post_insert(
+ ::boost::begin(result)
+ , ::boost::end(result)
+ , ::boost::has_stable_iterators_selector<Selector>()
+ );
+ return result;
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<Derived,T,Selector>::const_iterator
+ nary_node_base<Derived,T,Selector>::cbegin() const
+ {
+ return this->_children.cbegin();
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<Derived,T,Selector>::const_iterator
+ nary_node_base<Derived,T,Selector>::begin() const
+ {
+ return this->_children.begin();
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<Derived,T,Selector>::iterator
+ nary_node_base<Derived,T,Selector>::begin()
+ {
+ return this->_children.begin();
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<Derived,T,Selector>::const_iterator
+ nary_node_base<Derived,T,Selector>::cend() const
+ {
+ return this->_children.cend();
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<Derived,T,Selector>::const_iterator
+ nary_node_base<Derived,T,Selector>::end() const
+ {
+ return this->_children.end();
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<Derived,T,Selector>::iterator
+ nary_node_base<Derived,T,Selector>::end()
+ {
+ return this->_children.end();
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<Derived,T,Selector>::const_reverse_iterator
+ nary_node_base<Derived,T,Selector>::crbegin() const
+ {
+ return this->_children.crbegin();
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<Derived,T,Selector>::const_reverse_iterator
+ nary_node_base<Derived,T,Selector>::rbegin() const
+ {
+ return this->_children.rbegin();
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<Derived,T,Selector>::reverse_iterator
+ nary_node_base<Derived,T,Selector>::rbegin()
+ {
+ return this->_children.rbegin();
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<Derived,T,Selector>::const_reverse_iterator
+ nary_node_base<Derived,T,Selector>::crend() const
+ {
+ return this->_children.crend();
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<Derived,T,Selector>::const_reverse_iterator
+ nary_node_base<Derived,T,Selector>::rend() const
+ {
+ return this->_children.rend();
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<Derived,T,Selector>::reverse_iterator
+ nary_node_base<Derived,T,Selector>::rend()
+ {
+ return this->_children.rend();
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<Derived,T,Selector>::size_type
+ nary_node_base<Derived,T,Selector>::size() const
+ {
+ return this->_children.size();
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline bool nary_node_base<Derived,T,Selector>::empty() const
+ {
+ return this->_children.empty();
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline void nary_node_base<Derived,T,Selector>::clear()
+ {
+ this->_children.clear();
+ this->on_post_clear();
+ }
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <typename Derived, typename T, typename Selector>
+ template <typename ...Args>
+ inline typename nary_node_base<Derived,T,Selector>::iterator
+ nary_node_base<Derived,T,Selector>::_add_child(Args&& ...args)
+ {
+ typename ::boost::emplace_function_gen<Selector>::type emplacer;
+ ::std::pair<iterator,bool> p = emplacer(
+ this->_children
+ , ::boost::forward<Args>(args)...
+ );
+
+ if (p.second)
+ {
+ this->_initialize(p.first);
+ }
+
+ return p.first;
+ }
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#define BOOST_TREE_NODE_NARY_NODE_MACRO(z, n, _) \
+ template <typename Derived, typename T, typename Selector> \
+ BOOST_PP_EXPR_IF(n, template <) \
+ BOOST_PP_ENUM_PARAMS_Z(z, n, typename P) \
+ BOOST_PP_EXPR_IF(n, >) \
+ inline typename nary_node_base<Derived,T,Selector>::iterator \
+ nary_node_base<Derived,T,Selector>::_add_child( \
+ BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_LIST \
+ , _ \
+ ) \
+ ) \
+ { \
+ typename ::boost::emplace_function_gen<Selector>::type emplacer; \
+ ::std::pair<iterator,bool> p = emplacer( \
+ this->_children \
+ BOOST_PP_CAT(BOOST_PP_ENUM_TRAILING_, z)( \
+ n \
+ , BOOST_CONTAINER_PP_PARAM_FORWARD \
+ , _ \
+ ) \
+ ); \
+ if (p.second) \
+ { \
+ this->_initialize(p.first); \
+ } \
+ return p.first; \
+ } \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_NARY_NODE_MACRO
+ , _
+ )
+#undef BOOST_TREE_NODE_NARY_NODE_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ template <typename Derived, typename T, typename Selector>
+ inline void
+ nary_node_base<Derived,T,Selector>::_initialize(iterator& to_child)
+ {
+ (*to_child)._parent = this->get_derived();
+ (*to_child).on_post_inserted(
+ to_child
+ , ::boost::has_stable_iterators_selector<Selector>()
+ );
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ void
+ nary_node_base<Derived,T,Selector>::_link_children_to_parent(
+ pointer const& p
+ , iterator itr
+ , iterator itr_end
+ )
+ {
+ for (; itr != itr_end; ++itr)
+ {
+ (*itr)._parent = p;
+ }
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline void
+ nary_node_base<Derived,T,Selector>::_on_post_modify_value(
+ data_key const& key
+ )
+ {
+ this->on_post_propagate_value(key);
+ }
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ template <typename Derived, typename T, typename Selector>
+ template <typename FusionKey>
+ inline void
+ nary_node_base<Derived,T,Selector>::_on_post_modify_value(
+ FusionKey const& key
+ )
+ {
+ this->on_post_propagate_value(key);
+ }
+#endif
+}} // namespace boost::tree_node
+
+namespace boost { namespace tree_node {
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<
+ Derived
+ , T
+ , Selector
+ >::traits::data_type const&
+ get(
+ nary_node_base<Derived,T,Selector> const& node
+ , data_key const& key
+ )
+ {
+ return node[key];
+ }
+
+ template <typename Derived, typename T, typename Selector>
+ inline typename nary_node_base<Derived,T,Selector>::traits::data_type&
+ get(nary_node_base<Derived,T,Selector>& node, data_key const& key)
+ {
+ return node[key];
+ }
+
+#if !defined BOOST_NO_SFINAE
+ template <typename Key, typename Derived, typename T, typename Selector>
+ inline typename ::boost::enable_if<
+ ::std::tr1::is_same<Key,data_key>
+ , typename nary_node_base<
+ Derived
+ , T
+ , Selector
+ >::traits::data_type const&
+ >::type
+ get(nary_node_base<Derived,T,Selector> const& node)
+ {
+ return node[data_key()];
+ }
+
+ template <typename Key, typename Derived, typename T, typename Selector>
+ inline typename ::boost::enable_if<
+ ::std::tr1::is_same<Key,data_key>
+ , typename nary_node_base<
+ Derived
+ , T
+ , Selector
+ >::traits::data_type&
+ >::type
+ get(nary_node_base<Derived,T,Selector>& node)
+ {
+ return node[data_key()];
+ }
+#endif // BOOST_NO_SFINAE
+
+ template <typename Derived, typename T, typename Selector, typename V>
+ inline void
+ put(
+ nary_node_base<Derived,T,Selector>& node
+ , data_key const& key
+ , V const& value
+ )
+ {
+ node[key] = value;
+ node._on_post_modify_value(key);
+ }
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ template <
+ typename Derived
+ , typename T
+ , typename Selector
+ , typename FusionKey
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ nary_node_base<Derived,T,Selector>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<T const,FusionKey>
+ >::type
+ get(
+ nary_node_base<Derived,T,Selector> const& node
+ , FusionKey const& key
+ )
+ {
+ return node[key];
+ }
+
+ template <
+ typename Derived
+ , typename T
+ , typename Selector
+ , typename FusionKey
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ nary_node_base<Derived,T,Selector>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<T,FusionKey>
+ >::type
+ get(nary_node_base<Derived,T,Selector>& node, FusionKey const& key)
+ {
+ return node[key];
+ }
+
+ template <
+ typename FusionKey
+ , typename Derived
+ , typename T
+ , typename Selector
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ nary_node_base<Derived,T,Selector>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<T const,FusionKey>
+ >::type
+ get(nary_node_base<Derived,T,Selector> const& node)
+ {
+ return node[FusionKey()];
+ }
+
+ template <
+ typename FusionKey
+ , typename Derived
+ , typename T
+ , typename Selector
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ nary_node_base<Derived,T,Selector>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::fusion::result_of::at_key<T,FusionKey>
+ >::type
+ get(nary_node_base<Derived,T,Selector>& node)
+ {
+ return node[FusionKey()];
+ }
+
+ template <
+ typename Derived
+ , typename T
+ , typename Selector
+ , typename FusionKey
+ , typename V
+ >
+ inline void
+ put(
+ nary_node_base<Derived,T,Selector>& node
+ , FusionKey const& key
+ , V const& value
+ , typename ::boost::enable_if<
+ typename ::boost::mpl::if_<
+ typename ::boost::mpl::eval_if<
+ typename ::boost::fusion::traits::is_sequence<T>::type
+ , ::boost::fusion::traits::is_associative<T>
+ , ::boost::mpl::false_
+ >::type
+ , result_of::has_key<
+ nary_node_base<Derived,T,Selector>
+ , FusionKey
+ >
+ , ::boost::mpl::false_
+ >::type
+ , ::boost::mpl::true_
+ >::type
+ )
+ {
+ node[key] = value;
+ node._on_post_modify_value(key);
+ }
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+}} // namespace boost::tree_node
+
+//[reference__nary_node_base_gen
+namespace boost { namespace tree_node {
+
+ template <typename Selector = ::boost::ptr_dequeS>
+ struct nary_node_base_gen
+ {
+ template <typename Derived, typename T>
+ struct apply
+ {
+ typedef nary_node_base<Derived,T,Selector> type;
+ };
+ };
+
+ typedef nary_node_base_gen<> nary_node_base_default_gen;
+}} // namespace boost::tree_node
+//]
+
+namespace boost { namespace tree_node {
+
+ template <typename T, typename Selector>
+ struct nary_node
+ : public
+ //[reference__nary_node__bases
+ nary_node_base<nary_node<T,Selector>,T,Selector>
+ //]
+ {
+ //[reference__nary_node__super_t
+ typedef nary_node_base<nary_node,T,Selector>
+ super_t;
+ //]
+
+ //[reference__nary_node__traits
+ typedef typename super_t::traits
+ traits;
+ //]
+
+ //[reference__nary_node__pointer
+ typedef typename super_t::pointer
+ pointer;
+ //]
+
+ //[reference__nary_node__const_pointer
+ typedef typename super_t::const_pointer
+ const_pointer;
+ //]
+
+ //[reference__nary_node__iterator
+ typedef typename super_t::iterator
+ iterator;
+ //]
+
+ //[reference__nary_node__const_iterator
+ typedef typename super_t::const_iterator
+ const_iterator;
+ //]
+
+ //[reference__nary_node__reverse_iterator
+ typedef typename super_t::reverse_iterator
+ reverse_iterator;
+ //]
+
+ //[reference__nary_node__const_reverse_iterator
+ typedef typename super_t::const_reverse_iterator
+ const_reverse_iterator;
+ //]
+
+ //[reference__nary_node__size_type
+ typedef typename super_t::size_type
+ size_type;
+ //]
+
+ BOOST_TREE_NODE_COPYABLE_AND_MOVABLE(nary_node, super_t)
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ //[reference__nary_node__emplacement_ctor
+ template <typename ...Args>
+ explicit nary_node(Args&& ...args);
+ //]
+
+ //[reference__nary_node__emplacement_ctor_w_allocator
+ template <typename ...Args>
+ explicit nary_node(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ );
+ //]
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_INLINE_DEF
+ , (nary_node, super_t)
+ )
+
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_W_ALLOC_INLINE_DEF
+ , (nary_node, super_t)
+ )
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+ };
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <typename T, typename Selector>
+ template <typename ...Args>
+ inline nary_node<T,Selector>::nary_node(Args&& ...args)
+ : super_t(::boost::forward<Args>(args)...)
+ {
+ }
+
+ template <typename T, typename Selector>
+ template <typename ...Args>
+ inline nary_node<T,Selector>::nary_node(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ ) : super_t(
+ ::boost::container::allocator_arg
+ , allocator
+ , ::boost::forward<Args>(args)...
+ )
+ {
+ }
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+}} // namespace boost::tree_node
+
+//[reference__nary_node_gen
+namespace boost { namespace tree_node {
+
+ template <typename Selector = ::boost::ptr_dequeS>
+ struct nary_node_gen
+ {
+ template <typename T>
+ struct apply
+ {
+ typedef nary_node<T,Selector> type;
+ };
+ };
+
+ typedef nary_node_gen<> nary_node_default_gen;
+}} // namespace boost::tree_node
+//]
+
+#include <boost/tree_node/_detail/config_end.hpp>
+
+#endif // BOOST_TREE_NODE_NARY_NODE_HPP_INCLUDED
+

Added: sandbox/tree_node/boost/tree_node/with_accumulation.hpp
==============================================================================
--- (empty file)
+++ sandbox/tree_node/boost/tree_node/with_accumulation.hpp 2013-03-11 00:49:15 EDT (Mon, 11 Mar 2013)
@@ -0,0 +1,2598 @@
+// Copyright (C) 2012-2013 Cromwell D. Enage
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_TREE_NODE_WITH_ACCUMULATION_HPP_INCLUDED
+#define BOOST_TREE_NODE_WITH_ACCUMULATION_HPP_INCLUDED
+
+#include <boost/tree_node/with_accumulation_fwd.hpp>
+#include <boost/mpl/apply_wrap.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/accumulators/framework/accumulator_set.hpp>
+#include <boost/accumulators/framework/extractor.hpp>
+#include <boost/accumulators/framework/features.hpp>
+#include <boost/utility/value_init.hpp>
+#include <boost/tree_node/preprocessor.hpp>
+#include <boost/tree_node/base.hpp>
+#include <boost/tree_node/key/accumulation.hpp>
+#include <boost/tree_node/intrinsic/has_key.hpp>
+#include <boost/tree_node/intrinsic/get_keys.hpp>
+#include <boost/tree_node/intrinsic/at_key.hpp>
+#include <boost/tree_node/iterator/breadth_first_descendant.hpp>
+#include <boost/tree_node/iterator/dereference.hpp>
+#include <boost/assert.hpp>
+
+#if !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#include <boost/preprocessor/repetition/repeat.hpp>
+#endif
+
+#include <boost/tree_node/_detail/config_begin.hpp>
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/mpl/vector.hpp>
+#include <boost/move/move.hpp>
+#include <boost/type_traits/is_pod.hpp>
+
+namespace boost {
+
+ template <
+ typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename AccumulationKey
+ >
+ struct is_POD<
+ ::boost::tree_node::with_accumulation<
+ BaseGenerator
+ , T1
+ , T2
+ , AccumulationKey
+ >
+ > : ::boost::false_type
+ {
+ };
+
+ template <
+ typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename AccumulationKey
+ >
+ struct is_pod<
+ ::boost::tree_node::with_accumulation<
+ BaseGenerator
+ , T1
+ , T2
+ , AccumulationKey
+ >
+ > : ::boost::false_type
+ {
+ };
+} // namespace boost
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+namespace boost { namespace tree_node {
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ class with_accumulation_base
+ : public
+ //[reference__with_accumulation_base__bases
+ ::boost::mpl::eval_if<
+ ::std::tr1::is_void<T2>
+ , ::boost::mpl::apply_wrap2<BaseGenerator,Derived,T1>
+ , ::boost::mpl::apply_wrap3<BaseGenerator,Derived,T1,T2>
+ >::type
+ //]
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ , public accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+#endif
+ , private ::boost::noncopyable
+ {
+ friend struct tree_node_base<Derived>;
+
+ typedef with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+ self;
+
+ public:
+ typedef typename ::boost::mpl::eval_if<
+ ::std::tr1::is_void<T2>
+ , ::boost::mpl::apply_wrap2<BaseGenerator,Derived,T1>
+ , ::boost::mpl::apply_wrap3<BaseGenerator,Derived,T1,T2>
+ >::type
+ super_t;
+ typedef typename super_t::traits
+ traits;
+ typedef typename super_t::pointer
+ pointer;
+ typedef typename super_t::const_pointer
+ const_pointer;
+ typedef typename super_t::iterator
+ iterator;
+ typedef typename super_t::const_iterator
+ const_iterator;
+ typedef typename super_t::reverse_iterator
+ reverse_iterator;
+ typedef typename super_t::const_reverse_iterator
+ const_reverse_iterator;
+ typedef typename super_t::size_type
+ size_type;
+
+ private:
+ typedef typename ::boost::mpl::eval_if<
+ ::std::tr1::is_void<Value>
+ , result_of::value_at_key<self,Key>
+ , ::boost::mpl::identity<Value>
+ >::type
+ AccumulationValue;
+
+ AccumulationValue _accumulation;
+
+ protected:
+ //[reference__with_accumulation_base__derived_copy_ctor
+ with_accumulation_base(Derived const& copy);
+ //]
+
+ //[reference__with_accumulation_base__derived_copy_ctor_w_allocator
+ with_accumulation_base(
+ Derived const& copy
+ , typename traits::allocator_reference allocator
+ );
+ //]
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ with_accumulation_base(BOOST_RV_REF(Derived) source);
+
+ with_accumulation_base(
+ BOOST_RV_REF(Derived) source
+ , typename traits::allocator_reference allocator
+ );
+#endif
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ //[reference__with_accumulation_base__emplacement_ctor
+ template <typename ...Args>
+ explicit with_accumulation_base(Args&& ...args);
+ //]
+
+ //[reference__with_accumulation_base__emplacement_ctor_w_allocator
+ template <typename ...Args>
+ explicit with_accumulation_base(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ );
+ //]
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#define BOOST_TREE_NODE_WITH_ACCUMULATION_MACRO(z, n, Tuple) \
+ BOOST_TREE_NODE_EMPLACEMENT_CTOR_INLINE_HEADER(z, n, Tuple) \
+ , _accumulation( \
+ IncludesRoot::value \
+ ? ::boost::initialized_value \
+ : ::boost::accumulators::extractor<Tag>()( \
+ ::boost::accumulators::accumulator_set< \
+ AccumulationValue \
+ , ::boost::accumulators::features<Tag> \
+ >() \
+ ) \
+ ) \
+ { \
+ } \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_WITH_ACCUMULATION_MACRO
+ , (with_accumulation_base, super_t)
+ )
+#undef BOOST_TREE_NODE_WITH_ACCUMULATION_MACRO
+
+#define BOOST_TREE_NODE_WITH_ACCUMULATION_MACRO(z, n, Tuple) \
+ BOOST_TREE_NODE_EMPLACEMENT_CTOR_W_ALLOC_INLINE_HEADER(z, n, Tuple) \
+ , _accumulation( \
+ IncludesRoot::value \
+ ? ::boost::initialized_value \
+ : ::boost::accumulators::extractor<Tag>()( \
+ ::boost::accumulators::accumulator_set< \
+ AccumulationValue \
+ , ::boost::accumulators::features<Tag> \
+ >() \
+ ) \
+ ) \
+ { \
+ } \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_WITH_ACCUMULATION_MACRO
+ , (with_accumulation_base, super_t)
+ )
+#undef BOOST_TREE_NODE_WITH_ACCUMULATION_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ ~with_accumulation_base();
+
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ void copy_assign(Derived const& copy);
+#else
+ void copy_assign(BOOST_COPY_ASSIGN_REF(Derived) copy);
+
+ void move_assign(BOOST_RV_REF(Derived) source);
+#endif
+
+ void on_post_emplacement_construct();
+
+ void on_post_copy_or_move();
+
+ template <typename K>
+ void on_post_modify_value_impl(K const& key);
+
+ void on_post_modify_value_impl(Key const& key);
+
+ template <typename K>
+ void on_post_propagate_value_impl(K const& key);
+
+ void on_post_propagate_value_impl(Key const& key);
+
+ template <typename K>
+ void on_post_propagate_value_once_impl(K const& key);
+
+ void on_post_propagate_value_once_impl(Key const& key);
+
+ template <typename BooleanIntegralConstant>
+ void
+ on_post_inserted_impl(
+ iterator position
+ , BooleanIntegralConstant invalidates_sibling_positions
+ );
+
+ template <typename BooleanIntegralConstant>
+ void
+ on_post_insert_impl(
+ iterator itr
+ , iterator itr_end
+ , BooleanIntegralConstant invalidates_children_positions
+ );
+
+ void on_post_erase_impl();
+
+ void on_post_clear_impl();
+
+ void on_post_rotate_left_impl();
+
+ void on_post_rotate_right_impl();
+
+ public:
+ //[reference__with_accumulation_base__key_value_operator
+//<-
+#if 0
+//->
+ typename ::boost::mpl::eval_if<
+ ::std::tr1::is_void<Value>
+ , result_of::value_at_key<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+ , Key
+ >
+ , ::boost::mpl::identity<Value>
+ >::type const&
+//<-
+#endif
+ AccumulationValue const&
+//->
+ operator[](
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ > const&
+ )
+ const;
+ //]
+
+ private:
+ void
+ _set_accumulation(
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ > const&
+ );
+
+ void _update();
+
+ static void
+ _update(
+ pointer p
+ , accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ > const&
+ );
+ };
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::with_accumulation_base(Derived const& copy)
+ : super_t(copy)
+ , _accumulation(
+ static_cast<self const&>(copy)[
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ ]
+ )
+ {
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::with_accumulation_base(
+ Derived const& copy
+ , typename traits::allocator_reference allocator
+ ) : super_t(copy, allocator)
+ , _accumulation(
+ static_cast<self const&>(copy)[
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ ]
+ )
+ {
+ }
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::with_accumulation_base(
+#if defined BOOST_NO_RVALUE_REFERENCES
+ ::boost::rv<Derived>& source
+ ) : super_t(source)
+#else
+ Derived&& source
+ ) : super_t(static_cast<Derived&&>(source))
+#endif
+ , _accumulation(
+ static_cast<self&&>(source)[
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ ]
+ )
+ {
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::with_accumulation_base(
+#if defined BOOST_NO_RVALUE_REFERENCES
+ ::boost::rv<Derived>& source
+ , typename traits::allocator_reference allocator
+ ) : super_t(source, allocator)
+#else
+ Derived&& source
+ , typename traits::allocator_reference allocator
+ ) : super_t(static_cast<Derived&&>(source), allocator)
+#endif
+ , _accumulation(
+ static_cast<self&&>(source)[
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ ]
+ )
+ {
+ }
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ template <typename ...Args>
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::with_accumulation_base(Args&& ...args)
+ : super_t(::boost::forward<Args>(args)...)
+ , _accumulation(
+ IncludesRoot::value
+ ? ::boost::initialized_value
+ : ::boost::accumulators::extractor<Tag>()(
+ ::boost::accumulators::accumulator_set<
+ AccumulationValue
+ , ::boost::accumulators::features<Tag>
+ >()
+ )
+ )
+ {
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ template <typename ...Args>
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::with_accumulation_base(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ ) : super_t(
+ ::boost::container::allocator_arg
+ , allocator
+ , ::boost::forward<Args>(args)...
+ )
+ , _accumulation(
+ IncludesRoot::value
+ ? ::boost::initialized_value
+ : ::boost::accumulators::extractor<Tag>()(
+ ::boost::accumulators::accumulator_set<
+ AccumulationValue
+ , ::boost::accumulators::features<Tag>
+ >()
+ )
+ )
+ {
+ }
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::~with_accumulation_base()
+ {
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline void
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesRoot
+ , Value
+ >::copy_assign(Derived const& copy)
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::move_assign(BOOST_RV_REF(Derived) source)
+ {
+#if defined BOOST_NO_RVALUE_REFERENCES
+ super_t::move_assign(source);
+#else
+ super_t::move_assign(static_cast<Derived&&>(source));
+#endif
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline void
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::copy_assign(BOOST_COPY_ASSIGN_REF(Derived) copy)
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ {
+ super_t::copy_assign(copy);
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline void
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::on_post_emplacement_construct()
+ {
+ super_t::on_post_emplacement_construct();
+
+ if (IncludesRoot::value)
+ {
+ self::_accumulation = get<Key>(*this->get_derived());
+ }
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline void
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::on_post_copy_or_move()
+ {
+ super_t::on_post_copy_or_move();
+ this->_update();
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ template <typename K>
+ inline void
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::on_post_modify_value_impl(K const& key)
+ {
+ super_t::on_post_modify_value_impl(key);
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline void
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::on_post_modify_value_impl(Key const& key)
+ {
+ super_t::on_post_modify_value_impl(key);
+
+ if (IncludesRoot::value)
+ {
+ this->_set_accumulation(
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ );
+ this->on_post_modify_value(
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ );
+ }
+ else if (pointer p = this->get_parent_ptr())
+ {
+ static_cast<self*>(p)->_set_accumulation(
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ );
+ p->on_post_modify_value(
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ );
+ }
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ template <typename K>
+ inline void
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::on_post_propagate_value_impl(K const& key)
+ {
+ super_t::on_post_propagate_value_impl(key);
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline void
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::on_post_propagate_value_impl(Key const& key)
+ {
+ super_t::on_post_propagate_value_impl(key);
+
+ if (IncludesRoot::value)
+ {
+ this->_update();
+ }
+ else if (pointer p = this->get_parent_ptr())
+ {
+ static_cast<self*>(p)->_update();
+ }
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ template <typename K>
+ inline void
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::on_post_propagate_value_once_impl(K const& key)
+ {
+ super_t::on_post_propagate_value_once_impl(key);
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline void
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::on_post_propagate_value_once_impl(Key const& key)
+ {
+ super_t::on_post_propagate_value_once_impl(key);
+
+ if (IncludesRoot::value)
+ {
+ this->_set_accumulation(
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ );
+ }
+
+ self* p = this->get_parent_ptr();
+
+ BOOST_ASSERT_MSG(
+ p
+ , "Do not call on_post_propagate_value_once() on root."
+ );
+ p->_set_accumulation(
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ );
+
+ if ((p = p->get_parent_ptr()))
+ {
+ p->_set_accumulation(
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ );
+ }
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ template <typename BooleanIntegralConstant>
+ inline void
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::on_post_inserted_impl(
+ iterator position
+ , BooleanIntegralConstant invalidates_sibling_positions
+ )
+ {
+ super_t::on_post_inserted_impl(
+ position
+ , invalidates_sibling_positions
+ );
+ static_cast<self*>(this->get_parent_ptr())->_update();
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ template <typename BooleanIntegralConstant>
+ inline void
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::on_post_insert_impl(
+ iterator itr
+ , iterator itr_end
+ , BooleanIntegralConstant invalidates_children_positions
+ )
+ {
+ super_t::on_post_insert_impl(
+ itr
+ , itr_end
+ , invalidates_children_positions
+ );
+ this->_update();
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline void
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::on_post_erase_impl()
+ {
+ super_t::on_post_erase_impl();
+ this->_update();
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline void
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::on_post_clear_impl()
+ {
+ super_t::on_post_clear_impl();
+ this->_update();
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline void
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::on_post_rotate_left_impl()
+ {
+ super_t::on_post_rotate_left_impl();
+ this->_set_accumulation(
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ );
+ static_cast<self*>(this->get_parent_ptr())->_set_accumulation(
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ );
+ this->on_post_propagate_value_once(
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ );
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline void
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::on_post_rotate_right_impl()
+ {
+ super_t::on_post_rotate_right_impl();
+ this->_set_accumulation(
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ );
+ static_cast<self*>(this->get_parent_ptr())->_set_accumulation(
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ );
+ this->on_post_propagate_value_once(
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ );
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline typename with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::AccumulationValue const&
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::operator[](
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ > const&
+ ) const
+ {
+ return self::_accumulation;
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ void
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::_set_accumulation(
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ > const&
+ )
+ {
+ ::boost::accumulators::accumulator_set<
+ AccumulationValue
+ , ::boost::accumulators::features<Tag>
+ > acc;
+
+ if (IncludesRoot::value)
+ {
+ acc(get<Key>(*this->get_derived()));
+ }
+
+ if (IncludesAllDescendants::value)
+ {
+ for (
+ ::boost::tree_node::breadth_first_descendant_iterator<
+ Derived const
+ > c_itr(*this->get_derived());
+ c_itr;
+ ++c_itr
+ )
+ {
+ acc(get<Key>(::boost::tree_node::dereference_iterator(c_itr)));
+ }
+ }
+ else
+ {
+ const_iterator c_end = this->end();
+
+ for (const_iterator c_itr = this->begin(); c_itr != c_end; ++c_itr)
+ {
+ acc(get<Key>(::boost::tree_node::dereference_iterator(c_itr)));
+ }
+ }
+
+ self::_accumulation = ::boost::accumulators::extractor<
+ Tag
+ >()(acc);
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline void
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::_update()
+ {
+ self::_update(
+ this->get_derived()
+ , accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ );
+ this->on_post_propagate_value(
+ accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >()
+ );
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ void
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::_update(
+ pointer p
+ , accumulation_key<
+ Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ > const& key
+ )
+ {
+ do
+ {
+ static_cast<self*>(p)->_set_accumulation(key);
+ }
+ while ((p = p->get_parent_ptr()));
+ }
+}} // namespace boost::tree_node
+
+namespace boost { namespace tree_node {
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ , typename AccumulationKey
+ >
+ inline typename ::boost::enable_if<
+ ::std::tr1::is_same<
+ accumulation_key<Key,Tag,IncludesAllDescendants,IncludesRoot,Value>
+ , AccumulationKey
+ >
+ , typename ::boost::mpl::eval_if<
+ ::std::tr1::is_void<Value>
+ , result_of::value_at_key<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+ , Key
+ >
+ , ::boost::mpl::identity<Value>
+ >::type const&
+ >::type
+ get(
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ > const& node
+ , AccumulationKey const& key
+ )
+ {
+ return node[key];
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ , typename AccumulationKey
+ >
+ inline typename ::boost::lazy_disable_if<
+ typename ::boost::mpl::eval_if<
+ ::std::tr1::is_base_of<accumulation_key_base,AccumulationKey>
+ , ::std::tr1::is_same<
+ accumulation_key<Key,Tag,IncludesAllDescendants,IncludesRoot,Value>
+ , AccumulationKey
+ >
+ , ::boost::mpl::true_
+ >::type
+ , result_of::value_at_key<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+ , AccumulationKey
+ >
+ >::type
+ get(
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ > const& node
+ , AccumulationKey const& key
+ )
+ {
+ return get(
+ static_cast<
+ typename with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::super_t const&
+ >(node)
+ , key
+ );
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ , typename ExplicitKey
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::eval_if<
+ ::std::tr1::is_base_of<accumulation_key_base,ExplicitKey>
+ , ::boost::mpl::false_
+ , ::boost::mpl::eval_if<
+ ::std::tr1::is_same<ExplicitKey,Key>
+ , ::boost::mpl::false_
+ , result_of::has_key<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+ , ExplicitKey
+ >
+ >
+ >::type
+ , result_of::value_at_key<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ > const
+ , ExplicitKey
+ >
+ >::type
+ get(
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ > const& node
+ , ExplicitKey const& key
+ )
+ {
+ return get(
+ static_cast<
+ typename with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::super_t const&
+ >(node)
+ , key
+ );
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ , typename ExplicitKey
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::eval_if<
+ ::std::tr1::is_base_of<accumulation_key_base,ExplicitKey>
+ , ::boost::mpl::false_
+ , ::boost::mpl::eval_if<
+ ::std::tr1::is_same<ExplicitKey,Key>
+ , ::boost::mpl::false_
+ , result_of::has_key<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+ , ExplicitKey
+ >
+ >
+ >::type
+ , result_of::value_at_key<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+ , ExplicitKey
+ >
+ >::type
+ get(
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >& node
+ , ExplicitKey const& key
+ )
+ {
+ return get(
+ static_cast<
+ typename with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::super_t&
+ >(node)
+ , key
+ );
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ , typename ExplicitKey
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::eval_if<
+ ::std::tr1::is_base_of<accumulation_key_base,ExplicitKey>
+ , ::boost::mpl::false_
+ , ::std::tr1::is_same<ExplicitKey,Key>
+ >::type
+ , result_of::value_at_key<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ > const
+ , ExplicitKey
+ >
+ >::type
+ get(
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ > const& node
+ , ExplicitKey const& key
+ )
+ {
+ return get(
+ static_cast<
+ typename with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::super_t const&
+ >(node)
+ , key
+ );
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ , typename ExplicitKey
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::eval_if<
+ ::std::tr1::is_base_of<accumulation_key_base,ExplicitKey>
+ , ::boost::mpl::false_
+ , ::std::tr1::is_same<ExplicitKey,Key>
+ >::type
+ , result_of::value_at_key<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+ , ExplicitKey
+ >
+ >::type
+ get(
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >& node
+ , ExplicitKey const& key
+ )
+ {
+ return get(
+ static_cast<
+ typename with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::super_t&
+ >(node)
+ , key
+ );
+ }
+
+ template <
+ typename AccumulationKey
+ , typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline typename ::boost::enable_if<
+ ::std::tr1::is_same<
+ accumulation_key<Key,Tag,IncludesAllDescendants,IncludesRoot,Value>
+ , AccumulationKey
+ >
+ , typename ::boost::mpl::eval_if<
+ ::std::tr1::is_void<Value>
+ , result_of::value_at_key<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+ , Key
+ >
+ , ::boost::mpl::identity<Value>
+ >::type const&
+ >::type
+ get(
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ > const& node
+ )
+ {
+ return node[AccumulationKey()];
+ }
+
+ template <
+ typename AccumulationKey
+ , typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline typename ::boost::lazy_disable_if<
+ typename ::boost::mpl::eval_if<
+ ::std::tr1::is_base_of<accumulation_key_base,AccumulationKey>
+ , ::std::tr1::is_same<
+ accumulation_key<Key,Tag,IncludesAllDescendants,IncludesRoot,Value>
+ , AccumulationKey
+ >
+ , ::boost::mpl::true_
+ >::type
+ , result_of::value_at_key<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+ , AccumulationKey
+ >
+ >::type
+ get(
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ > const& node
+ )
+ {
+ return get<AccumulationKey>(
+ static_cast<
+ typename with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::super_t const&
+ >(node)
+ );
+ }
+
+ template <
+ typename ExplicitKey
+ , typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::eval_if<
+ ::std::tr1::is_base_of<accumulation_key_base,ExplicitKey>
+ , ::boost::mpl::false_
+ , ::boost::mpl::eval_if<
+ ::std::tr1::is_same<ExplicitKey,Key>
+ , ::boost::mpl::false_
+ , result_of::has_key<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+ , ExplicitKey
+ >
+ >
+ >::type
+ , result_of::value_at_key<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ > const
+ , ExplicitKey
+ >
+ >::type
+ get(
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ > const& node
+ )
+ {
+ return get<ExplicitKey>(
+ static_cast<
+ typename with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::super_t const&
+ >(node)
+ );
+ }
+
+ template <
+ typename ExplicitKey
+ , typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::eval_if<
+ ::std::tr1::is_base_of<accumulation_key_base,ExplicitKey>
+ , ::boost::mpl::false_
+ , ::boost::mpl::eval_if<
+ ::std::tr1::is_same<ExplicitKey,Key>
+ , ::boost::mpl::false_
+ , result_of::has_key<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+ , ExplicitKey
+ >
+ >
+ >::type
+ , result_of::value_at_key<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+ , ExplicitKey
+ >
+ >::type
+ get(
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >& node
+ )
+ {
+ return get<ExplicitKey>(
+ static_cast<
+ typename with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::super_t&
+ >(node)
+ );
+ }
+
+ template <
+ typename ExplicitKey
+ , typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::eval_if<
+ ::std::tr1::is_base_of<accumulation_key_base,ExplicitKey>
+ , ::boost::mpl::false_
+ , ::std::tr1::is_same<ExplicitKey,Key>
+ >::type
+ , result_of::value_at_key<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ > const
+ , ExplicitKey
+ >
+ >::type
+ get(
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ > const& node
+ )
+ {
+ return get<Key>(
+ static_cast<
+ typename with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::super_t const&
+ >(node)
+ );
+ }
+
+ template <
+ typename ExplicitKey
+ , typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ inline typename ::boost::lazy_enable_if<
+ typename ::boost::mpl::eval_if<
+ ::std::tr1::is_base_of<accumulation_key_base,ExplicitKey>
+ , ::boost::mpl::false_
+ , ::std::tr1::is_same<ExplicitKey,Key>
+ >::type
+ , result_of::value_at_key<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+ , ExplicitKey
+ >
+ >::type
+ get(
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >& node
+ )
+ {
+ return get<Key>(
+ static_cast<
+ typename with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >::super_t&
+ >(node)
+ );
+ }
+}} // namespace boost::tree_node
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+namespace boost { namespace tree_node { namespace result_of {
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ struct has_key_impl<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+ , accumulation_key<Key,Tag,IncludesAllDescendants,IncludesRoot,Value>
+ > : ::boost::mpl::true_
+ {
+ };
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ struct get_keys_impl<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+ > : ::boost::mpl::vector1<
+ accumulation_key<Key,Tag,IncludesAllDescendants,IncludesRoot,Value>
+ >
+ {
+ };
+
+ template <
+ typename Key
+ , typename Tag
+ , typename IncludesAllDescendants
+ , typename IncludesRoot
+ , typename Value
+ >
+ struct at_key_impl<
+ accumulation_key<Key,Tag,IncludesAllDescendants,IncludesRoot,Value>
+ >
+ {
+ template <typename Node>
+ struct apply : apply<typename Node::super_t>
+ {
+ };
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ struct apply<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+ > : ::boost::mpl::eval_if<
+ ::std::tr1::is_void<Value>
+ , value_at_key<
+ with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Key
+ , Tag
+ , IncludesAllDescendants
+ , IncludesRoot
+ , Value
+ >
+ , Key
+ >
+ , ::boost::mpl::identity<Value>
+ >
+ {
+ };
+ };
+}}} // namespace boost::tree_node::result_of
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+//[reference__with_accumulation_base_gen
+namespace boost { namespace tree_node {
+
+ template <
+ typename BaseGenerator
+ , typename AccumulationKey = default_accumulation_key
+ >
+ struct with_accumulation_base_gen
+ {
+ template <typename Derived, typename T1, typename T2 = void>
+ struct apply
+ {
+ typedef with_accumulation_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , typename AccumulationKey::key
+ , typename AccumulationKey::tag
+ , typename AccumulationKey::includes_all_descendants
+ , typename AccumulationKey::includes_root
+ , typename AccumulationKey::value
+ >
+ type;
+ };
+ };
+}} // namespace boost::tree_node
+//]
+
+namespace boost { namespace tree_node {
+
+ template <
+ typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename AccumulationKey
+ >
+ struct with_accumulation
+ : public
+ //[reference__with_accumulation__bases
+ with_accumulation_base<
+ with_accumulation<
+ BaseGenerator
+ , T1
+ , T2
+ , AccumulationKey
+ >
+ , BaseGenerator
+ , T1
+ , T2
+ , typename AccumulationKey::key
+ , typename AccumulationKey::tag
+ , typename AccumulationKey::includes_all_descendants
+ , typename AccumulationKey::includes_root
+ , typename AccumulationKey::value
+ >
+ //]
+ {
+ //[reference__with_accumulator__super_t
+ typedef with_accumulation_base<
+ with_accumulation
+ , BaseGenerator
+ , T1
+ , T2
+ , typename AccumulationKey::key
+ , typename AccumulationKey::tag
+ , typename AccumulationKey::includes_all_descendants
+ , typename AccumulationKey::includes_root
+ , typename AccumulationKey::value
+ >
+ super_t;
+ //]
+
+ typedef typename super_t::traits
+ traits;
+ typedef typename super_t::pointer
+ pointer;
+ typedef typename super_t::const_pointer
+ const_pointer;
+ typedef typename super_t::iterator
+ iterator;
+ typedef typename super_t::const_iterator
+ const_iterator;
+ typedef typename super_t::reverse_iterator
+ reverse_iterator;
+ typedef typename super_t::const_reverse_iterator
+ const_reverse_iterator;
+ typedef typename super_t::size_type
+ size_type;
+
+ BOOST_TREE_NODE_COPYABLE_AND_MOVABLE(with_accumulation, super_t)
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ //[reference__with_accumulation__emplacement_ctor
+ template <typename ...Args>
+ explicit with_accumulation(Args&& ...args);
+ //]
+
+ //[reference__with_accumulation__emplacement_ctor_w_allocator
+ template <typename ...Args>
+ explicit with_accumulation(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ );
+ //]
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_INLINE_DEF
+ , (with_accumulation, super_t)
+ )
+
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_W_ALLOC_INLINE_DEF
+ , (with_accumulation, super_t)
+ )
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+ };
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <
+ typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename AccumulationKey
+ >
+ template <typename ...Args>
+ inline with_accumulation<
+ BaseGenerator
+ , T1
+ , T2
+ , AccumulationKey
+ >::with_accumulation(Args&& ...args)
+ : super_t(::boost::forward<Args>(args)...)
+ {
+ super_t::on_post_emplacement_construct();
+ }
+
+ template <
+ typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename AccumulationKey
+ >
+ template <typename ...Args>
+ inline with_accumulation<
+ BaseGenerator
+ , T1
+ , T2
+ , AccumulationKey
+ >::with_accumulation(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ ) : super_t(
+ ::boost::container::allocator_arg
+ , allocator
+ , ::boost::forward<Args>(args)...
+ )
+ {
+ super_t::on_post_emplacement_construct();
+ }
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+}} // namespace boost::tree_node
+
+//[reference__with_accumulation_gen
+namespace boost { namespace tree_node {
+
+ template <
+ typename BaseGenerator
+ , typename AccumulationKey = default_accumulation_key
+ >
+ struct with_accumulation_gen
+ {
+ template <typename Derived, typename T1, typename T2 = void>
+ struct apply
+ {
+ typedef with_accumulation<BaseGenerator,T1,T2,AccumulationKey>
+ type;
+ };
+ };
+}} // namespace boost::tree_node
+//]
+
+#include <boost/tree_node/_detail/config_end.hpp>
+
+#endif // BOOST_TREE_NODE_WITH_ACCUMULATION_HPP_INCLUDED
+

Added: sandbox/tree_node/boost/tree_node/with_count.hpp
==============================================================================
--- (empty file)
+++ sandbox/tree_node/boost/tree_node/with_count.hpp 2013-03-11 00:49:15 EDT (Mon, 11 Mar 2013)
@@ -0,0 +1,971 @@
+// Copyright (C) 2012-2013 Cromwell D. Enage
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_TREE_NODE_WITH_COUNT_HPP_INCLUDED
+#define BOOST_TREE_NODE_WITH_COUNT_HPP_INCLUDED
+
+#include <cstddef>
+#include <boost/tr1/type_traits.hpp>
+#include <boost/mpl/apply_wrap.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/utility/value_init.hpp>
+#include <boost/tree_node/preprocessor.hpp>
+#include <boost/tree_node/base.hpp>
+#include <boost/tree_node/with_count_fwd.hpp>
+#include <boost/tree_node/key/count.hpp>
+#include <boost/tree_node/intrinsic/has_key.hpp>
+#include <boost/tree_node/intrinsic/get_keys.hpp>
+#include <boost/tree_node/intrinsic/at_key.hpp>
+#include <boost/tree_node/iterator/dereference.hpp>
+
+#if !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#include <boost/preprocessor/repetition/repeat.hpp>
+#endif
+
+#include <boost/tree_node/_detail/config_begin.hpp>
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/mpl/vector.hpp>
+#include <boost/move/move.hpp>
+#include <boost/type_traits/is_pod.hpp>
+
+namespace boost {
+
+ template <typename BaseGenerator, typename T1, typename T2, typename Count>
+ struct is_POD<
+ ::boost::tree_node::with_count<BaseGenerator,T1,T2,Count>
+ > : ::boost::false_type
+ {
+ };
+
+ template <typename BaseGenerator, typename T1, typename T2, typename Count>
+ struct is_pod<
+ ::boost::tree_node::with_count<BaseGenerator,T1,T2,Count>
+ > : ::boost::false_type
+ {
+ };
+} // namespace boost
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+namespace boost { namespace tree_node {
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ class with_count_base
+ : public
+ //[reference__with_count_base__bases
+ ::boost::mpl::eval_if<
+ ::std::tr1::is_void<T2>
+ , ::boost::mpl::apply_wrap2<BaseGenerator,Derived,T1>
+ , ::boost::mpl::apply_wrap3<BaseGenerator,Derived,T1,T2>
+ >::type
+ //]
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ , public count_key
+#endif
+ , private ::boost::noncopyable
+ {
+ friend struct tree_node_base<Derived>;
+
+ typedef with_count_base<Derived,BaseGenerator,T1,T2,Count>
+ self;
+
+ public:
+ typedef typename ::boost::mpl::eval_if<
+ ::std::tr1::is_void<T2>
+ , ::boost::mpl::apply_wrap2<BaseGenerator,Derived,T1>
+ , ::boost::mpl::apply_wrap3<BaseGenerator,Derived,T1,T2>
+ >::type
+ super_t;
+ typedef typename super_t::pointer
+ pointer;
+ typedef typename super_t::const_pointer
+ const_pointer;
+ typedef typename super_t::iterator
+ iterator;
+ typedef typename super_t::const_iterator
+ const_iterator;
+ typedef typename super_t::reverse_iterator
+ reverse_iterator;
+ typedef typename super_t::const_reverse_iterator
+ const_reverse_iterator;
+ typedef typename super_t::size_type
+ size_type;
+
+ //[reference__with_count_base__traits
+ struct traits : super_t::traits
+ {
+ typedef typename ::boost::mpl::if_<
+ ::std::tr1::is_void<Count>
+ , size_type
+ , Count
+ >::type
+ count;
+ };
+ //]
+
+ private:
+ typename traits::count _count;
+
+ protected:
+ //[reference__with_count_base__derived_copy_ctor
+ with_count_base(Derived const& copy);
+ //]
+
+ //[reference__with_count_base__derived_copy_ctor_w_allocator
+ with_count_base(
+ Derived const& copy
+ , typename traits::allocator_reference allocator
+ );
+ //]
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ with_count_base(BOOST_RV_REF(Derived) source);
+
+ with_count_base(
+ BOOST_RV_REF(Derived) source
+ , typename traits::allocator_reference allocator
+ );
+#endif
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ //[reference__with_count_base__emplacement_ctor
+ template <typename ...Args>
+ explicit with_count_base(Args&& ...args);
+ //]
+
+ //[reference__with_count_base__emplacement_ctor_w_allocator
+ template <typename ...Args>
+ explicit with_count_base(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ );
+ //]
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#define BOOST_TREE_NODE_WITH_COUNT_MACRO(z, n, Tuple) \
+ BOOST_TREE_NODE_EMPLACEMENT_CTOR_INLINE_HEADER(z, n, Tuple) \
+ , _count(::boost::initialized_value) \
+ { \
+ ++this->_count; \
+ } \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_WITH_COUNT_MACRO
+ , (with_count_base, super_t)
+ )
+#undef BOOST_TREE_NODE_WITH_COUNT_MACRO
+
+#define BOOST_TREE_NODE_WITH_COUNT_MACRO(z, n, Tuple) \
+ BOOST_TREE_NODE_EMPLACEMENT_CTOR_W_ALLOC_INLINE_HEADER(z, n, Tuple) \
+ , _count(::boost::initialized_value) \
+ { \
+ ++this->_count; \
+ } \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_WITH_COUNT_MACRO
+ , (with_count_base, super_t)
+ )
+#undef BOOST_TREE_NODE_WITH_COUNT_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ ~with_count_base();
+
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ void copy_assign(Derived const& copy);
+#else
+ void copy_assign(BOOST_COPY_ASSIGN_REF(Derived) copy);
+
+ void move_assign(BOOST_RV_REF(Derived) source);
+#endif
+
+ void on_post_copy_or_move();
+
+ template <typename BooleanIntegralConstant>
+ void
+ on_post_inserted_impl(
+ iterator position
+ , BooleanIntegralConstant invalidates_sibling_positions
+ );
+
+ template <typename BooleanIntegralConstant>
+ void
+ on_post_insert_impl(
+ iterator itr
+ , iterator itr_end
+ , BooleanIntegralConstant invalidates_children_positions
+ );
+
+ void on_post_erase_impl();
+
+ void on_post_clear_impl();
+
+ void on_post_rotate_left_impl();
+
+ void on_post_rotate_right_impl();
+
+ public:
+ //[reference__with_count_base__key_value_operator
+ typename traits::count const& operator[](count_key const&) const;
+ //]
+
+ private:
+ void _shallow_update();
+
+ static typename traits::count
+ _get_count(const_iterator c_itr, const_iterator c_end);
+
+ static void
+ _update_less_count(
+ pointer p
+ , typename traits::count const& difference
+ );
+
+ static void
+ _update_greater_count(
+ pointer p
+ , typename traits::count const& difference
+ );
+ };
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ with_count_base<Derived,BaseGenerator,T1,T2,Count>::with_count_base(
+ Derived const& copy
+ ) : super_t(copy), _count(copy._count)
+ {
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ with_count_base<Derived,BaseGenerator,T1,T2,Count>::with_count_base(
+ Derived const& copy
+ , typename traits::allocator_reference allocator
+ ) : super_t(copy, allocator), _count(copy._count)
+ {
+ }
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ with_count_base<Derived,BaseGenerator,T1,T2,Count>::with_count_base(
+#if defined BOOST_NO_RVALUE_REFERENCES
+ ::boost::rv<Derived>& source
+ ) : super_t(source)
+#else
+ Derived&& source
+ ) : super_t(static_cast<Derived&&>(source))
+#endif
+ , _count(source._count)
+ {
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ with_count_base<Derived,BaseGenerator,T1,T2,Count>::with_count_base(
+#if defined BOOST_NO_RVALUE_REFERENCES
+ ::boost::rv<Derived>& source
+ , typename traits::allocator_reference allocator
+ ) : super_t(source, allocator)
+#else
+ Derived&& source
+ , typename traits::allocator_reference allocator
+ ) : super_t(static_cast<Derived&&>(source), allocator)
+#endif
+ , _count(source._count)
+ {
+ }
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ template <typename ...Args>
+ with_count_base<Derived,BaseGenerator,T1,T2,Count>::with_count_base(
+ Args&& ...args
+ ) : super_t(::boost::forward<Args>(args)...)
+ , _count(::boost::initialized_value)
+ {
+ ++this->_count;
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ template <typename ...Args>
+ with_count_base<Derived,BaseGenerator,T1,T2,Count>::with_count_base(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ ) : super_t(
+ ::boost::container::allocator_arg
+ , allocator
+ , ::boost::forward<Args>(args)...
+ )
+ , _count(::boost::initialized_value)
+ {
+ ++this->_count;
+ }
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ with_count_base<Derived,BaseGenerator,T1,T2,Count>::~with_count_base()
+ {
+ }
+
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ inline void
+ with_count_base<Derived,BaseGenerator,T1,T2,Count>::copy_assign(
+ Derived const& copy
+ )
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ inline void
+ with_count_base<Derived,BaseGenerator,T1,T2,Count>::move_assign(
+ BOOST_RV_REF(Derived) source
+ )
+ {
+#if defined BOOST_NO_RVALUE_REFERENCES
+ super_t::move_assign(source);
+#else
+ super_t::move_assign(static_cast<Derived&&>(source));
+#endif
+// this->_count = source._count;
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ inline void
+ with_count_base<Derived,BaseGenerator,T1,T2,Count>::copy_assign(
+ BOOST_COPY_ASSIGN_REF(Derived) copy
+ )
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ {
+ super_t::copy_assign(copy);
+// this->_count = copy._count;
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ inline void
+ with_count_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Count
+ >::on_post_copy_or_move()
+ {
+ super_t::on_post_copy_or_move();
+ this->_shallow_update();
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ template <typename BooleanIntegralConstant>
+ inline void
+ with_count_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Count
+ >::on_post_inserted_impl(
+ iterator position
+ , BooleanIntegralConstant invalidates_sibling_positions
+ )
+ {
+ super_t::on_post_inserted_impl(
+ position
+ , invalidates_sibling_positions
+ );
+ self::_update_greater_count(this->get_derived(), this->_count);
+ this->on_post_propagate_value(count_key());
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ template <typename BooleanIntegralConstant>
+ void
+ with_count_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Count
+ >::on_post_insert_impl(
+ iterator itr
+ , iterator itr_end
+ , BooleanIntegralConstant invalidates_children_positions
+ )
+ {
+ super_t::on_post_insert_impl(
+ itr
+ , itr_end
+ , invalidates_children_positions
+ );
+ typename traits::count new_count = self::_get_count(itr, itr_end);
+ this->_count += new_count;
+
+ for (
+ self::_update_greater_count(this->get_derived(), new_count);
+ itr != itr_end;
+ ++itr
+ )
+ {
+ dereference_iterator(itr).on_post_modify_value(count_key());
+ }
+
+ this->on_post_propagate_value(count_key());
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ inline void
+ with_count_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Count
+ >::on_post_erase_impl()
+ {
+ super_t::on_post_erase_impl();
+ this->_shallow_update();
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ inline void
+ with_count_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Count
+ >::on_post_clear_impl()
+ {
+ super_t::on_post_clear_impl();
+ self::_update_less_count(this->get_derived(), --this->_count);
+ ++(this->_count = ::boost::initialized_value);
+ this->on_post_propagate_value(count_key());
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ inline void
+ with_count_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Count
+ >::on_post_rotate_left_impl()
+ {
+ super_t::on_post_rotate_left_impl();
+
+ pointer p = this->get_parent_ptr();
+
+ if (p->get_right_child_ptr())
+ {
+ this->_count -= p->get_right_child_ptr()->_count;
+ }
+
+ if (this->get_left_child_ptr())
+ {
+ p->_count += this->get_left_child_ptr()->_count;
+ }
+
+ --this->_count;
+ ++p->_count;
+ this->on_post_propagate_value_once(count_key());
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ inline void
+ with_count_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Count
+ >::on_post_rotate_right_impl()
+ {
+ super_t::on_post_rotate_right_impl();
+
+ pointer p = this->get_parent_ptr();
+
+ if (pointer l = p->get_left_child_ptr())
+ {
+ this->_count -= p->get_left_child_ptr()->_count;
+ }
+
+ if (this->get_right_child_ptr())
+ {
+ p->_count += this->get_right_child_ptr()->_count;
+ }
+
+ --this->_count;
+ ++p->_count;
+ this->on_post_propagate_value_once(count_key());
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ inline typename with_count_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Count
+ >::traits::count const&
+ with_count_base<Derived,BaseGenerator,T1,T2,Count>::operator[](
+ count_key const&
+ ) const
+ {
+ return this->_count;
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ void with_count_base<Derived,BaseGenerator,T1,T2,Count>::_shallow_update()
+ {
+ typename traits::count new_count = self::_get_count(
+ this->begin()
+ , this->end()
+ );
+
+ if (++new_count < this->_count)
+ {
+ self::_update_less_count(
+ this->get_derived()
+ , this->_count - new_count
+ );
+ this->_count = new_count;
+ this->on_post_propagate_value(count_key());
+ }
+ else if (this->_count < new_count)
+ {
+ self::_update_greater_count(
+ this->get_derived()
+ , new_count - this->_count
+ );
+ this->_count = new_count;
+ this->on_post_propagate_value(count_key());
+ }
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ typename with_count_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Count
+ >::traits::count
+ with_count_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Count
+ >::_get_count(const_iterator c_itr, const_iterator c_end)
+ {
+ typename traits::count result = ::boost::initialized_value;
+
+ while (c_itr != c_end)
+ {
+ result += ::boost::tree_node::dereference_iterator(
+ c_itr
+ )._count;
+ ++c_itr;
+ }
+
+ return result;
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ void
+ with_count_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Count
+ >::_update_less_count(
+ pointer p
+ , typename traits::count const& difference
+ )
+ {
+ while ((p = p->get_parent_ptr()))
+ {
+ p->_count -= difference;
+ }
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ void
+ with_count_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Count
+ >::_update_greater_count(
+ pointer p
+ , typename traits::count const& difference
+ )
+ {
+ while ((p = p->get_parent_ptr()))
+ {
+ p->_count += difference;
+ }
+ }
+}} // namespace boost::tree_node
+
+namespace boost { namespace tree_node {
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ inline typename with_count_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Count
+ >::traits::count const&
+ get(
+ with_count_base<Derived,BaseGenerator,T1,T2,Count> const& node
+ , count_key const& key
+ )
+ {
+ return node[key];
+ }
+
+#if !defined BOOST_NO_SFINAE
+ template <
+ typename Key
+ , typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ inline typename ::boost::enable_if<
+ ::std::tr1::is_same<Key,count_key>
+ , typename with_count_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Count
+ >::traits::count const&
+ >::type
+ get(with_count_base<Derived,BaseGenerator,T1,T2,Count> const& node)
+ {
+ return node[count_key()];
+ }
+#endif // BOOST_NO_SFINAE
+}} // namespace boost::tree_node
+
+namespace boost { namespace tree_node { namespace result_of {
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ struct has_key_impl<
+ with_count_base<Derived,BaseGenerator,T1,T2,Count>
+ , count_key
+ > : ::boost::mpl::true_
+ {
+ };
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Count
+ >
+ struct get_keys_impl<
+ with_count_base<Derived,BaseGenerator,T1,T2,Count>
+ > : ::boost::mpl::vector1<count_key>
+ {
+ };
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ template <>
+ struct at_key_impl<count_key>
+ {
+ template <typename Node>
+ struct apply
+ {
+ typedef typename Node::traits::count const& type;
+ };
+ };
+}}} // namespace boost::tree_node::result_of
+
+//[reference__with_count_base_gen
+namespace boost { namespace tree_node {
+
+ template <typename BaseGenerator, typename Count = void>
+ struct with_count_base_gen
+ {
+ template <typename Derived, typename T1, typename T2 = void>
+ struct apply
+ {
+ typedef with_count_base<Derived,BaseGenerator,T1,T2,Count> type;
+ };
+ };
+}} // namespace boost::tree_node
+//]
+
+namespace boost { namespace tree_node {
+
+ template <typename BaseGenerator, typename T1, typename T2, typename Count>
+ struct with_count
+ : public
+ //[reference__with_count__bases
+ with_count_base<
+ with_count<BaseGenerator,T1,T2,Count>
+ , BaseGenerator
+ , T1
+ , T2
+ , Count
+ >
+ //]
+ {
+ typedef with_count_base<with_count,BaseGenerator,T1,T2,Count>
+ super_t;
+ typedef typename super_t::traits
+ traits;
+ typedef typename super_t::pointer
+ pointer;
+ typedef typename super_t::const_pointer
+ const_pointer;
+ typedef typename super_t::iterator
+ iterator;
+ typedef typename super_t::const_iterator
+ const_iterator;
+ typedef typename super_t::reverse_iterator
+ reverse_iterator;
+ typedef typename super_t::const_reverse_iterator
+ const_reverse_iterator;
+ typedef typename super_t::size_type
+ size_type;
+
+ BOOST_TREE_NODE_COPYABLE_AND_MOVABLE(with_count, super_t)
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ //[reference__with_count__emplacement_ctor
+ template <typename ...Args>
+ explicit with_count(Args&& ...args);
+ //]
+
+ //[reference__with_count__emplacement_ctor_w_allocator
+ template <typename ...Args>
+ explicit with_count(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ );
+ //]
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_INLINE_DEF
+ , (with_count, super_t)
+ )
+
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_W_ALLOC_INLINE_DEF
+ , (with_count, super_t)
+ )
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+ };
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <typename BaseGenerator, typename T1, typename T2, typename Count>
+ template <typename ...Args>
+ inline with_count<BaseGenerator,T1,T2,Count>::with_count(Args&& ...args)
+ : super_t(::boost::forward<Args>(args)...)
+ {
+ super_t::on_post_emplacement_construct();
+ }
+
+ template <typename BaseGenerator, typename T1, typename T2, typename Count>
+ template <typename ...Args>
+ inline with_count<BaseGenerator,T1,T2,Count>::with_count(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ ) : super_t(
+ ::boost::container::allocator_arg
+ , allocator
+ , ::boost::forward<Args>(args)...
+ )
+ {
+ super_t::on_post_emplacement_construct();
+ }
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+}} // namespace boost::tree_node
+
+//[reference__with_count_gen
+namespace boost { namespace tree_node {
+
+ template <typename BaseGenerator, typename Count = void>
+ struct with_count_gen
+ {
+ template <typename T1, typename T2 = void>
+ struct apply
+ {
+ typedef with_count<BaseGenerator,T1,T2,Count> type;
+ };
+ };
+}} // namespace boost::tree_node
+//]
+
+#include <boost/tree_node/_detail/config_end.hpp>
+
+#endif // BOOST_TREE_NODE_WITH_COUNT_HPP_INCLUDED
+

Added: sandbox/tree_node/boost/tree_node/with_height.hpp
==============================================================================
--- (empty file)
+++ sandbox/tree_node/boost/tree_node/with_height.hpp 2013-03-11 00:49:15 EDT (Mon, 11 Mar 2013)
@@ -0,0 +1,963 @@
+// Copyright (C) 2011-2013 Cromwell D. Enage
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_TREE_NODE_WITH_HEIGHT_HPP_INCLUDED
+#define BOOST_TREE_NODE_WITH_HEIGHT_HPP_INCLUDED
+
+#include <cstddef>
+#include <boost/tr1/type_traits.hpp>
+#include <boost/mpl/apply_wrap.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/utility/value_init.hpp>
+#include <boost/tree_node/preprocessor.hpp>
+#include <boost/tree_node/base.hpp>
+#include <boost/tree_node/with_height_fwd.hpp>
+#include <boost/tree_node/key/height.hpp>
+#include <boost/tree_node/intrinsic/has_key.hpp>
+#include <boost/tree_node/intrinsic/get_keys.hpp>
+#include <boost/tree_node/intrinsic/at_key.hpp>
+#include <boost/tree_node/iterator/dereference.hpp>
+
+#if !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#include <boost/preprocessor/repetition/repeat.hpp>
+#endif
+
+#include <boost/tree_node/_detail/config_begin.hpp>
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/mpl/vector.hpp>
+#include <boost/move/move.hpp>
+#include <boost/type_traits/is_pod.hpp>
+
+namespace boost {
+
+ template <
+ typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ struct is_POD<
+ ::boost::tree_node::with_height<BaseGenerator,T1,T2,Height>
+ > : ::boost::false_type
+ {
+ };
+
+ template <
+ typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ struct is_pod<
+ ::boost::tree_node::with_height<BaseGenerator,T1,T2,Height>
+ > : ::boost::false_type
+ {
+ };
+} // namespace boost
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+namespace boost { namespace tree_node {
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ class with_height_base
+ : public
+ //[reference__with_height_base__bases
+ ::boost::mpl::eval_if<
+ ::std::tr1::is_void<T2>
+ , ::boost::mpl::apply_wrap2<BaseGenerator,Derived,T1>
+ , ::boost::mpl::apply_wrap3<BaseGenerator,Derived,T1,T2>
+ >::type
+ //]
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ , public height_key
+#endif
+ , private ::boost::noncopyable
+ {
+ friend struct tree_node_base<Derived>;
+
+ typedef with_height_base<Derived,BaseGenerator,T1,T2,Height>
+ self;
+
+ public:
+ typedef typename ::boost::mpl::eval_if<
+ ::std::tr1::is_void<T2>
+ , ::boost::mpl::apply_wrap2<BaseGenerator,Derived,T1>
+ , ::boost::mpl::apply_wrap3<BaseGenerator,Derived,T1,T2>
+ >::type
+ super_t;
+ typedef typename super_t::pointer
+ pointer;
+ typedef typename super_t::const_pointer
+ const_pointer;
+ typedef typename super_t::iterator
+ iterator;
+ typedef typename super_t::const_iterator
+ const_iterator;
+ typedef typename super_t::reverse_iterator
+ reverse_iterator;
+ typedef typename super_t::const_reverse_iterator
+ const_reverse_iterator;
+ typedef typename super_t::size_type
+ size_type;
+
+ //[reference__with_height_base__traits
+ struct traits : super_t::traits
+ {
+ typedef typename ::boost::mpl::if_<
+ ::std::tr1::is_void<Height>
+ , size_type
+ , Height
+ >::type
+ height;
+ };
+ //]
+
+ private:
+ typename traits::height _height;
+
+ protected:
+ //[reference__with_height_base__derived_copy_ctor
+ with_height_base(Derived const& copy);
+ //]
+
+ //[reference__with_height_base__derived_copy_ctor_w_allocator
+ with_height_base(
+ Derived const& copy
+ , typename traits::allocator_reference allocator
+ );
+ //]
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ with_height_base(BOOST_RV_REF(Derived) source);
+
+ with_height_base(
+ BOOST_RV_REF(Derived) source
+ , typename traits::allocator_reference allocator
+ );
+#endif
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ //[reference__with_height_base__emplacement_ctor
+ template <typename ...Args>
+ explicit with_height_base(Args&& ...args);
+ //]
+
+ //[reference__with_height_base__emplacement_ctor_w_allocator
+ template <typename ...Args>
+ explicit with_height_base(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ );
+ //]
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#define BOOST_TREE_NODE_WITH_HEIGHT_MACRO(z, n, Tuple) \
+ BOOST_TREE_NODE_EMPLACEMENT_CTOR_INLINE_HEADER(z, n, Tuple) \
+ , _height(::boost::initialized_value) \
+ { \
+ } \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_WITH_HEIGHT_MACRO
+ , (with_height_base, super_t)
+ )
+#undef BOOST_TREE_NODE_WITH_HEIGHT_MACRO
+
+#define BOOST_TREE_NODE_WITH_HEIGHT_MACRO(z, n, Tuple) \
+ BOOST_TREE_NODE_EMPLACEMENT_CTOR_W_ALLOC_INLINE_HEADER(z, n, Tuple) \
+ , _height(::boost::initialized_value) \
+ { \
+ } \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_WITH_HEIGHT_MACRO
+ , (with_height_base, super_t)
+ )
+#undef BOOST_TREE_NODE_WITH_HEIGHT_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ ~with_height_base();
+
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ void copy_assign(Derived const& copy);
+#else
+ void copy_assign(BOOST_COPY_ASSIGN_REF(Derived) copy);
+
+ void move_assign(BOOST_RV_REF(Derived) source);
+#endif
+
+ void on_post_copy_or_move();
+
+ template <typename BooleanIntegralConstant>
+ void
+ on_post_inserted_impl(
+ iterator position
+ , BooleanIntegralConstant invalidates_sibling_positions
+ );
+
+ template <typename BooleanIntegralConstant>
+ void
+ on_post_insert_impl(
+ iterator itr
+ , iterator itr_end
+ , BooleanIntegralConstant invalidates_children_positions
+ );
+
+ void on_post_erase_impl();
+
+ void on_post_clear_impl();
+
+ void on_post_rotate_left_impl();
+
+ void on_post_rotate_right_impl();
+
+ public:
+ //[reference__with_height_base__key_value_operator
+ typename traits::height const& operator[](height_key const&) const;
+ //]
+
+ private:
+ void _shallow_update();
+
+ static typename traits::height
+ _get_max_height(const_iterator c_itr, const_iterator c_end);
+
+ static void _update_less_height(pointer p);
+
+ static void _update_greater_height(pointer p);
+ };
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ with_height_base<Derived,BaseGenerator,T1,T2,Height>::with_height_base(
+ Derived const& copy
+ ) : super_t(copy), _height(copy._height)
+ {
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ with_height_base<Derived,BaseGenerator,T1,T2,Height>::with_height_base(
+ Derived const& copy
+ , typename traits::allocator_reference allocator
+ ) : super_t(copy, allocator), _height(copy._height)
+ {
+ }
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ with_height_base<Derived,BaseGenerator,T1,T2,Height>::with_height_base(
+#if defined BOOST_NO_RVALUE_REFERENCES
+ ::boost::rv<Derived>& source
+ ) : super_t(source)
+#else
+ Derived&& source
+ ) : super_t(static_cast<Derived&&>(source))
+#endif
+ , _height(source._height)
+ {
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ with_height_base<Derived,BaseGenerator,T1,T2,Height>::with_height_base(
+#if defined BOOST_NO_RVALUE_REFERENCES
+ ::boost::rv<Derived>& source
+ , typename traits::allocator_reference allocator
+ ) : super_t(source, allocator)
+#else
+ Derived&& source
+ , typename traits::allocator_reference allocator
+ ) : super_t(static_cast<Derived&&>(source), allocator)
+#endif
+ , _height(source._height)
+ {
+ }
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ template <typename ...Args>
+ with_height_base<Derived,BaseGenerator,T1,T2,Height>::with_height_base(
+ Args&& ...args
+ ) : super_t(::boost::forward<Args>(args)...)
+ , _height(::boost::initialized_value)
+ {
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ template <typename ...Args>
+ with_height_base<Derived,BaseGenerator,T1,T2,Height>::with_height_base(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ ) : super_t(
+ ::boost::container::allocator_arg
+ , allocator
+ , ::boost::forward<Args>(args)...
+ )
+ , _height(::boost::initialized_value)
+ {
+ }
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ with_height_base<Derived,BaseGenerator,T1,T2,Height>::~with_height_base()
+ {
+ }
+
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ inline void
+ with_height_base<Derived,BaseGenerator,T1,T2,Height>::copy_assign(
+ Derived const& copy
+ )
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ inline void
+ with_height_base<Derived,BaseGenerator,T1,T2,Height>::move_assign(
+ BOOST_RV_REF(Derived) source
+ )
+ {
+#if defined BOOST_NO_RVALUE_REFERENCES
+ super_t::move_assign(source);
+#else
+ super_t::move_assign(static_cast<Derived&&>(source));
+#endif
+// this->_height = source._height;
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ inline void
+ with_height_base<Derived,BaseGenerator,T1,T2,Height>::copy_assign(
+ BOOST_COPY_ASSIGN_REF(Derived) copy
+ )
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ {
+ super_t::copy_assign(copy);
+// this->_height = copy._height;
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ inline void
+ with_height_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Height
+ >::on_post_copy_or_move()
+ {
+ super_t::on_post_copy_or_move();
+ this->_shallow_update();
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ template <typename BooleanIntegralConstant>
+ inline void
+ with_height_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Height
+ >::on_post_inserted_impl(
+ iterator position
+ , BooleanIntegralConstant invalidates_sibling_positions
+ )
+ {
+ super_t::on_post_inserted_impl(
+ position
+ , invalidates_sibling_positions
+ );
+ this->get_parent_ptr()->_shallow_update();
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ template <typename BooleanIntegralConstant>
+ inline void
+ with_height_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Height
+ >::on_post_insert_impl(
+ iterator itr
+ , iterator itr_end
+ , BooleanIntegralConstant invalidates_children_positions
+ )
+ {
+ super_t::on_post_insert_impl(
+ itr
+ , itr_end
+ , invalidates_children_positions
+ );
+ typename traits::height new_height = self::_get_max_height(
+ itr
+ , itr_end
+ );
+
+ if (this->_height < new_height)
+ {
+ this->_height = new_height;
+ self::_update_greater_height(this->get_derived());
+ this->on_post_propagate_value(height_key());
+ }
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ inline void
+ with_height_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Height
+ >::on_post_erase_impl()
+ {
+ super_t::on_post_erase_impl();
+ this->_shallow_update();
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ inline void
+ with_height_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Height
+ >::on_post_clear_impl()
+ {
+ super_t::on_post_clear_impl();
+ this->_height = ::boost::initialized_value;
+ self::_update_less_height(this->get_derived());
+ this->on_post_propagate_value(height_key());
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ inline void
+ with_height_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Height
+ >::on_post_rotate_left_impl()
+ {
+ super_t::on_post_rotate_left_impl();
+ this->_shallow_update();
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ inline void
+ with_height_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Height
+ >::on_post_rotate_right_impl()
+ {
+ super_t::on_post_rotate_right_impl();
+ this->_shallow_update();
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ inline typename with_height_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Height
+ >::traits::height const&
+ with_height_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Height
+ >::operator[](height_key const&) const
+ {
+ return this->_height;
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ void
+ with_height_base<Derived,BaseGenerator,T1,T2,Height>::_shallow_update()
+ {
+ typename traits::height new_height = self::_get_max_height(
+ this->begin()
+ , this->end()
+ );
+
+ if (new_height < this->_height)
+ {
+ this->_height = new_height;
+ self::_update_less_height(this->get_derived());
+ this->on_post_propagate_value(height_key());
+ }
+ else if (this->_height < new_height)
+ {
+ this->_height = new_height;
+ self::_update_greater_height(this->get_derived());
+ this->on_post_propagate_value(height_key());
+ }
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ typename with_height_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Height
+ >::traits::height
+ with_height_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Height
+ >::_get_max_height(const_iterator c_itr, const_iterator c_end)
+ {
+ typename traits::height result = ::boost::initialized_value;
+
+ for (typename traits::height height_plus_1; c_itr != c_end; ++c_itr)
+ {
+ height_plus_1 = ::boost::tree_node::dereference_iterator(
+ c_itr
+ )._height;
+
+ if (result < ++height_plus_1)
+ {
+ result = height_plus_1;
+ }
+ }
+
+ return result;
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ void
+ with_height_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Height
+ >::_update_less_height(pointer p)
+ {
+ typename traits::height new_height;
+
+ while ((p = p->get_parent_ptr()))
+ {
+ new_height = self::_get_max_height(p->begin(), p->end());
+
+ if (p->_height == new_height)
+ {
+ return;
+ }
+ else
+ {
+ // This is no longer the deepest branch.
+ p->_height = new_height;
+ }
+ }
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ void
+ with_height_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Height
+ >::_update_greater_height(pointer p)
+ {
+ typename traits::height p_height = p->_height;
+
+ while ((p = p->get_parent_ptr()) && (p->_height < ++p_height))
+ {
+ // This is the new deepest branch.
+ p->_height = p_height;
+ }
+ }
+}} // namespace boost::tree_node
+
+namespace boost { namespace tree_node {
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ inline typename with_height_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Height
+ >::traits::height const&
+ get(
+ with_height_base<Derived,BaseGenerator,T1,T2,Height> const& node
+ , height_key const& key
+ )
+ {
+ return node[key];
+ }
+
+#if !defined BOOST_NO_SFINAE
+ template <
+ typename Key
+ , typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ inline typename ::boost::enable_if<
+ ::std::tr1::is_same<Key,height_key>
+ , typename with_height_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ , Height
+ >::traits::height const&
+ >::type
+ get(with_height_base<Derived,BaseGenerator,T1,T2,Height> const& node)
+ {
+ return node[height_key()];
+ }
+#endif // BOOST_NO_SFINAE
+}} // namespace boost::tree_node
+
+namespace boost { namespace tree_node { namespace result_of {
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ struct has_key_impl<
+ with_height_base<Derived,BaseGenerator,T1,T2,Height>
+ , height_key
+ > : ::boost::mpl::true_
+ {
+ };
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ struct get_keys_impl<
+ with_height_base<Derived,BaseGenerator,T1,T2,Height>
+ > : ::boost::mpl::vector1<height_key>
+ {
+ };
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ template <>
+ struct at_key_impl<height_key>
+ {
+ template <typename Node>
+ struct apply
+ {
+ typedef typename Node::traits::height const& type;
+ };
+ };
+}}} // namespace boost::tree_node::result_of
+
+//[reference__with_height_base_gen
+namespace boost { namespace tree_node {
+
+ template <typename BaseGenerator, typename Height = void>
+ struct with_height_base_gen
+ {
+ template <typename Derived, typename T1, typename T2 = void>
+ struct apply
+ {
+ typedef with_height_base<Derived,BaseGenerator,T1,T2,Height> type;
+ };
+ };
+}} // namespace boost::tree_node
+//]
+
+namespace boost { namespace tree_node {
+
+ template <
+ typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ struct with_height
+ : public
+ //[reference__with_height__bases
+ with_height_base<
+ with_height<BaseGenerator,T1,T2,Height>
+ , BaseGenerator
+ , T1
+ , T2
+ , Height
+ >
+ //]
+ {
+ typedef with_height_base<with_height,BaseGenerator,T1,T2,Height>
+ super_t;
+ typedef typename super_t::traits
+ traits;
+ typedef typename super_t::pointer
+ pointer;
+ typedef typename super_t::const_pointer
+ const_pointer;
+ typedef typename super_t::iterator
+ iterator;
+ typedef typename super_t::const_iterator
+ const_iterator;
+ typedef typename super_t::reverse_iterator
+ reverse_iterator;
+ typedef typename super_t::const_reverse_iterator
+ const_reverse_iterator;
+ typedef typename super_t::size_type
+ size_type;
+
+ BOOST_TREE_NODE_COPYABLE_AND_MOVABLE(with_height, super_t)
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ //[reference__with_height__emplacement_ctor
+ template <typename ...Args>
+ explicit with_height(Args&& ...args);
+ //]
+
+ //[reference__with_height__emplacement_ctor_w_allocator
+ template <typename ...Args>
+ explicit with_height(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ );
+ //]
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_INLINE_DEF
+ , (with_height, super_t)
+ )
+
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_W_ALLOC_INLINE_DEF
+ , (with_height, super_t)
+ )
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+ };
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <
+ typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ template <typename ...Args>
+ inline with_height<BaseGenerator,T1,T2,Height>::with_height(Args&& ...args)
+ : super_t(::boost::forward<Args>(args)...)
+ {
+ super_t::on_post_emplacement_construct();
+ }
+
+ template <
+ typename BaseGenerator
+ , typename T1
+ , typename T2
+ , typename Height
+ >
+ template <typename ...Args>
+ inline with_height<BaseGenerator,T1,T2,Height>::with_height(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ ) : super_t(
+ ::boost::container::allocator_arg
+ , allocator
+ , ::boost::forward<Args>(args)...
+ )
+ {
+ super_t::on_post_emplacement_construct();
+ }
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+}} // namespace boost::tree_node
+
+//[reference__with_height_gen
+namespace boost { namespace tree_node {
+
+ template <typename BaseGenerator, typename Height = void>
+ struct with_height_gen
+ {
+ template <typename T1, typename T2 = void>
+ struct apply
+ {
+ typedef with_height<BaseGenerator,T1,T2,Height> type;
+ };
+ };
+}} // namespace boost::tree_node
+//]
+
+#include <boost/tree_node/_detail/config_end.hpp>
+
+#endif // BOOST_TREE_NODE_WITH_HEIGHT_HPP_INCLUDED
+

Added: sandbox/tree_node/boost/tree_node/with_position.hpp
==============================================================================
--- (empty file)
+++ sandbox/tree_node/boost/tree_node/with_position.hpp 2013-03-11 00:49:15 EDT (Mon, 11 Mar 2013)
@@ -0,0 +1,713 @@
+// Copyright (C) 2011-2013 Cromwell D. Enage
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_TREE_NODE_WITH_POSITION_HPP_INCLUDED
+#define BOOST_TREE_NODE_WITH_POSITION_HPP_INCLUDED
+
+#include <boost/tr1/type_traits.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/apply_wrap.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/detail/metafunction/container_iterator.hpp>
+#include <boost/tree_node/preprocessor.hpp>
+#include <boost/tree_node/base.hpp>
+#include <boost/tree_node/with_position_fwd.hpp>
+#include <boost/tree_node/key/position.hpp>
+#include <boost/tree_node/intrinsic/has_key.hpp>
+#include <boost/tree_node/intrinsic/get_keys.hpp>
+#include <boost/tree_node/intrinsic/at_key.hpp>
+#include <boost/tree_node/iterator/dereference.hpp>
+
+#if !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#include <boost/preprocessor/repetition/repeat.hpp>
+#endif
+
+#include <boost/tree_node/_detail/config_begin.hpp>
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/mpl/vector.hpp>
+#include <boost/move/move.hpp>
+#include <boost/type_traits/is_pod.hpp>
+
+namespace boost {
+
+ template <typename BaseGenerator, typename T1, typename T2>
+ struct is_POD<
+ ::boost::tree_node::with_position<BaseGenerator,T1,T2>
+ > : ::boost::false_type
+ {
+ };
+
+ template <typename BaseGenerator, typename T1, typename T2>
+ struct is_pod<
+ ::boost::tree_node::with_position<BaseGenerator,T1,T2>
+ > : ::boost::false_type
+ {
+ };
+} // namespace boost
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+namespace boost { namespace tree_node {
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ class with_position_base
+ : public
+ //[reference__with_position_base__bases
+ ::boost::mpl::eval_if<
+ ::std::tr1::is_void<T2>
+ , ::boost::mpl::apply_wrap2<BaseGenerator,Derived,T1>
+ , ::boost::mpl::apply_wrap3<BaseGenerator,Derived,T1,T2>
+ >::type
+ //]
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ , public position_key
+#endif
+ , private ::boost::noncopyable
+ {
+ friend struct tree_node_base<Derived>;
+
+ public:
+ typedef typename ::boost::mpl::eval_if<
+ ::std::tr1::is_void<T2>
+ , ::boost::mpl::apply_wrap2<BaseGenerator,Derived,T1>
+ , ::boost::mpl::apply_wrap3<BaseGenerator,Derived,T1,T2>
+ >::type
+ super_t;
+ typedef typename super_t::traits
+ traits;
+ typedef typename super_t::pointer
+ pointer;
+ typedef typename super_t::const_pointer
+ const_pointer;
+ typedef typename super_t::iterator
+ iterator;
+ typedef typename super_t::const_iterator
+ const_iterator;
+ typedef typename super_t::reverse_iterator
+ reverse_iterator;
+ typedef typename super_t::const_reverse_iterator
+ const_reverse_iterator;
+ typedef typename super_t::size_type
+ size_type;
+
+ private:
+ iterator _position;
+
+ protected:
+ //[reference__with_position_base__derived_copy_ctor
+ with_position_base(Derived const& copy);
+ //]
+
+ //[reference__with_position_base__derived_copy_ctor_w_allocator
+ with_position_base(
+ Derived const& copy
+ , typename traits::allocator_reference allocator
+ );
+ //]
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ with_position_base(BOOST_RV_REF(Derived) source);
+
+ with_position_base(
+ BOOST_RV_REF(Derived) source
+ , typename traits::allocator_reference allocator
+ );
+#endif
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ //[reference__with_position_base__emplacement_ctor
+ template <typename ...Args>
+ explicit with_position_base(Args&& ...args);
+ //]
+
+ //[reference__with_position_base__emplacement_ctor_w_allocator
+ template <typename ...Args>
+ explicit with_position_base(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ );
+ //]
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+#define BOOST_TREE_NODE_WITH_POSITION_MACRO(z, n, Tuple) \
+ BOOST_TREE_NODE_EMPLACEMENT_CTOR_INLINE_HEADER(z, n, Tuple) \
+ , _position() \
+ { \
+ } \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_WITH_POSITION_MACRO
+ , (with_position_base, super_t)
+ )
+#undef BOOST_TREE_NODE_WITH_POSITION_MACRO
+
+#define BOOST_TREE_NODE_WITH_POSITION_MACRO(z, n, Tuple) \
+ BOOST_TREE_NODE_EMPLACEMENT_CTOR_W_ALLOC_INLINE_HEADER(z, n, Tuple) \
+ , _position() \
+ { \
+ } \
+//!
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_WITH_POSITION_MACRO
+ , (with_position_base, super_t)
+ )
+#undef BOOST_TREE_NODE_WITH_POSITION_MACRO
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ ~with_position_base();
+
+ void on_post_copy_or_move();
+
+ void on_post_inserted_impl(iterator position, ::boost::mpl::true_);
+
+ void on_post_inserted_impl(iterator position, ::boost::mpl::false_);
+
+ void
+ on_post_insert_impl(
+ iterator itr
+ , iterator itr_end
+ , ::boost::mpl::true_
+ );
+
+ void
+ on_post_insert_impl(
+ iterator itr
+ , iterator itr_end
+ , ::boost::mpl::false_
+ );
+
+ public:
+ //[reference__with_position_base__key_value_operator__const
+ const_iterator operator[](position_key const&) const;
+ //]
+
+ //[reference__with_position_base__key_value_operator
+ iterator operator[](position_key const&);
+ //]
+
+ private:
+ static void _set_child_positions(pointer to_parent);
+ };
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ with_position_base<Derived,BaseGenerator,T1,T2>::with_position_base(
+ Derived const& copy
+ ) : super_t(copy), _position()
+ {
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ with_position_base<Derived,BaseGenerator,T1,T2>::with_position_base(
+ Derived const& copy
+ , typename traits::allocator_reference allocator
+ ) : super_t(copy, allocator), _position()
+ {
+ }
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ with_position_base<Derived,BaseGenerator,T1,T2>::with_position_base(
+#if defined BOOST_NO_RVALUE_REFERENCES
+ ::boost::rv<Derived>& source
+ ) : super_t(source)
+#else
+ Derived&& source
+ ) : super_t(static_cast<Derived&&>(source))
+#endif
+ , _position()
+ {
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ with_position_base<Derived,BaseGenerator,T1,T2>::with_position_base(
+#if defined BOOST_NO_RVALUE_REFERENCES
+ ::boost::rv<Derived>& source
+ , typename traits::allocator_reference allocator
+ ) : super_t(source, allocator)
+#else
+ Derived&& source
+ , typename traits::allocator_reference allocator
+ ) : super_t(static_cast<Derived&&>(source), allocator)
+#endif
+ , _position()
+ {
+ }
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ template <typename ...Args>
+ with_position_base<Derived,BaseGenerator,T1,T2>::with_position_base(
+ Args&& ...args
+ ) : super_t(::boost::forward<Args>(args)...), _position()
+ {
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ template <typename ...Args>
+ with_position_base<Derived,BaseGenerator,T1,T2>::with_position_base(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ ) : super_t(
+ ::boost::container::allocator_arg
+ , allocator
+ , ::boost::forward<Args>(args)...
+ )
+ , _position()
+ {
+ }
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ with_position_base<Derived,BaseGenerator,T1,T2>::~with_position_base()
+ {
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ inline void
+ with_position_base<Derived,BaseGenerator,T1,T2>::on_post_copy_or_move()
+ {
+ super_t::on_post_copy_or_move();
+ this->_set_child_positions(this->get_derived());
+ this->on_post_modify_value(position_key());
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ inline void
+ with_position_base<Derived,BaseGenerator,T1,T2>::on_post_inserted_impl(
+ iterator position
+ , ::boost::mpl::true_ t
+ )
+ {
+ super_t::on_post_inserted_impl(position, t);
+ this->_position = position;
+ this->on_post_modify_value(position_key());
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ void
+ with_position_base<Derived,BaseGenerator,T1,T2>::on_post_inserted_impl(
+ iterator position
+ , ::boost::mpl::false_ f
+ )
+ {
+ super_t::on_post_inserted_impl(position, f);
+ this->_set_child_positions(this->get_parent_ptr());
+
+ iterator itr_end = this->get_parent_ptr()->end();
+
+ for (
+ iterator itr = this->get_parent_ptr()->begin();
+ itr != itr_end;
+ ++itr
+ )
+ {
+ dereference_iterator(itr).on_post_modify_value(position_key());
+ }
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ void
+ with_position_base<Derived,BaseGenerator,T1,T2>::on_post_insert_impl(
+ iterator itr
+ , iterator itr_end
+ , ::boost::mpl::true_ t
+ )
+ {
+ for (
+ super_t::on_post_insert_impl(itr, itr_end, t);
+ itr != itr_end;
+ ++itr
+ )
+ {
+ dereference_iterator(itr)._position = itr;
+ dereference_iterator(itr).on_post_modify_value(position_key());
+ }
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ void
+ with_position_base<Derived,BaseGenerator,T1,T2>::on_post_insert_impl(
+ iterator itr
+ , iterator itr_end
+ , ::boost::mpl::false_ f
+ )
+ {
+ super_t::on_post_insert_impl(itr, itr_end, f);
+ itr_end = this->end();
+
+ for (itr = this->begin(); itr != itr_end; ++itr)
+ {
+ dereference_iterator(itr)._position = itr;
+ dereference_iterator(itr).on_post_modify_value(position_key());
+ }
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ inline typename with_position_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ >::const_iterator
+ with_position_base<Derived,BaseGenerator,T1,T2>::operator[](
+ position_key const&
+ ) const
+ {
+ return this->_position;
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ inline typename with_position_base<Derived,BaseGenerator,T1,T2>::iterator
+ with_position_base<Derived,BaseGenerator,T1,T2>::operator[](
+ position_key const&
+ )
+ {
+ return this->_position;
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ void
+ with_position_base<Derived,BaseGenerator,T1,T2>::_set_child_positions(
+ pointer to_parent
+ )
+ {
+ iterator itr_end = to_parent->end();
+
+ for (iterator itr = to_parent->begin(); itr != itr_end; ++itr)
+ {
+ dereference_iterator(itr)._position = itr;
+ }
+ }
+}} // namespace boost::tree_node
+
+namespace boost { namespace tree_node {
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ inline typename with_position_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ >::const_iterator
+ get(
+ with_position_base<Derived,BaseGenerator,T1,T2> const& node
+ , position_key const& key
+ )
+ {
+ return node[key];
+ }
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ inline typename with_position_base<Derived,BaseGenerator,T1,T2>::iterator
+ get(
+ with_position_base<Derived,BaseGenerator,T1,T2>& node
+ , position_key const& key
+ )
+ {
+ return node[key];
+ }
+
+#if !defined BOOST_NO_SFINAE
+ template <
+ typename Key
+ , typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ inline typename ::boost::enable_if<
+ ::std::tr1::is_same<Key,position_key>
+ , typename with_position_base<
+ Derived
+ , BaseGenerator
+ , T1
+ , T2
+ >::const_iterator
+ >::type
+ get(with_position_base<Derived,BaseGenerator,T1,T2> const& node)
+ {
+ return node[position_key()];
+ }
+
+ template <
+ typename Key
+ , typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ inline typename ::boost::enable_if<
+ ::std::tr1::is_same<Key,position_key>
+ , typename with_position_base<Derived,BaseGenerator,T1,T2>::iterator
+ >::type
+ get(with_position_base<Derived,BaseGenerator,T1,T2>& node)
+ {
+ return node[position_key()];
+ }
+#endif // BOOST_NO_SFINAE
+}} // namespace boost::tree_node
+
+namespace boost { namespace tree_node { namespace result_of {
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ struct has_key_impl<
+ with_position_base<Derived,BaseGenerator,T1,T2>
+ , position_key
+ > : ::boost::mpl::true_
+ {
+ };
+
+ template <
+ typename Derived
+ , typename BaseGenerator
+ , typename T1
+ , typename T2
+ >
+ struct get_keys_impl<
+ with_position_base<Derived,BaseGenerator,T1,T2>
+ > : ::boost::mpl::vector1<position_key>
+ {
+ };
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ template <>
+ struct at_key_impl<position_key>
+ {
+ template <typename Node>
+ struct apply
+ {
+ typedef typename ::boost::detail::metafunction::container_iterator<
+ Node
+ >::type
+ type;
+ };
+ };
+}}} // namespace boost::tree_node::result_of
+
+//[reference__with_position_base_gen
+namespace boost { namespace tree_node {
+
+ template <typename BaseGenerator>
+ struct with_position_base_gen
+ {
+ template <typename Derived, typename T1, typename T2 = void>
+ struct apply
+ {
+ typedef with_position_base<Derived,BaseGenerator,T1,T2> type;
+ };
+ };
+}} // namespace boost::tree_node
+//]
+
+namespace boost { namespace tree_node {
+
+ template <typename BaseGenerator, typename T1, typename T2>
+ struct with_position
+ : public
+ //[reference__with_position__bases
+ with_position_base<
+ with_position<BaseGenerator,T1,T2>
+ , BaseGenerator
+ , T1
+ , T2
+ >
+ //]
+ {
+ typedef with_position_base<with_position,BaseGenerator,T1,T2>
+ super_t;
+ typedef typename super_t::traits
+ traits;
+ typedef typename super_t::pointer
+ pointer;
+ typedef typename super_t::const_pointer
+ const_pointer;
+ typedef typename super_t::iterator
+ iterator;
+ typedef typename super_t::const_iterator
+ const_iterator;
+ typedef typename super_t::reverse_iterator
+ reverse_iterator;
+ typedef typename super_t::const_reverse_iterator
+ const_reverse_iterator;
+ typedef typename super_t::size_type
+ size_type;
+
+ BOOST_TREE_NODE_COPYABLE_AND_MOVABLE(with_position, super_t)
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ //[reference__with_position__emplacement_ctor
+ template <typename ...Args>
+ explicit with_position(Args&& ...args);
+ //]
+
+ //[reference__with_position__emplacement_ctor_w_allocator
+ template <typename ...Args>
+ explicit with_position(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ );
+ //]
+#else // !defined BOOST_CONTAINER_PERFECT_FORWARDING
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_INLINE_DEF
+ , (with_position, super_t)
+ )
+
+ BOOST_PP_REPEAT(
+ BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS
+ , BOOST_TREE_NODE_EMPLACEMENT_CTOR_W_ALLOC_INLINE_DEF
+ , (with_position, super_t)
+ )
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+ };
+
+#if defined BOOST_CONTAINER_PERFECT_FORWARDING
+ template <typename BaseGenerator, typename T1, typename T2>
+ template <typename ...Args>
+ inline with_position<BaseGenerator,T1,T2>::with_position(Args&& ...args)
+ : super_t(::boost::forward<Args>(args)...)
+ {
+ super_t::on_post_emplacement_construct();
+ }
+
+ template <typename BaseGenerator, typename T1, typename T2>
+ template <typename ...Args>
+ inline with_position<BaseGenerator,T1,T2>::with_position(
+ ::boost::container::allocator_arg_t
+ , typename traits::allocator_reference allocator
+ , Args&& ...args
+ ) : super_t(
+ ::boost::container::allocator_arg
+ , allocator
+ , ::boost::forward<Args>(args)...
+ )
+ {
+ super_t::on_post_emplacement_construct();
+ }
+#endif // BOOST_CONTAINER_PERFECT_FORWARDING
+}} // namespace boost::tree_node
+
+//[reference__with_position_gen
+namespace boost { namespace tree_node {
+
+ template <typename BaseGenerator>
+ struct with_position_gen
+ {
+ template <typename T1, typename T2 = void>
+ struct apply
+ {
+ typedef with_position<BaseGenerator,T1,T2> type;
+ };
+ };
+}} // namespace boost::tree_node
+//]
+
+#include <boost/tree_node/_detail/config_end.hpp>
+
+#endif // BOOST_TREE_NODE_WITH_POSITION_HPP_INCLUDED
+

Added: sandbox/tree_node/libs/tree_node/example/nary_node.cpp
==============================================================================
--- (empty file)
+++ sandbox/tree_node/libs/tree_node/example/nary_node.cpp 2013-03-11 00:49:15 EDT (Mon, 11 Mar 2013)
@@ -0,0 +1,697 @@
+// Copyright (C) 2011-2013 Cromwell D. Enage
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//#define __BOOST_TEST_TREE_NODE_TEST_SPLICE_ONE_ELEMENT__
+
+#include <iterator>
+#include <iostream>
+#include <boost/config.hpp>
+#include <boost/tr1/type_traits.hpp>
+#include <boost/typeof/boost/container_gen/selectors.hpp>
+#include <boost/typeof/boost/rational.hpp>
+#include <boost/typeof/boost/tree_node/nary_node.hpp>
+#include <boost/typeof/boost/tree_node/with_count.hpp>
+#include <boost/typeof/boost/tree_node/with_height.hpp>
+#include <boost/typeof/boost/tree_node/with_position.hpp>
+#include <boost/tree_node/iterator/breadth_first.hpp>
+#include <boost/tree_node/iterator/pre_order_descendant.hpp>
+#include <boost/tree_node/iterator/post_order.hpp>
+#include <boost/tree_node/preprocessor.hpp>
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+#include <boost/typeof/boost/tree_node/with_accumulation.hpp>
+#endif
+
+#include "type_definitions.hpp"
+#include "output_preamble.hpp"
+#include "output_functions.hpp"
+#include "iterator_functions.hpp"
+
+template <typename Selector, typename Node>
+void initialize(Node& root)
+{
+ for (boost::tree_node::breadth_first_iterator<Node> itr(root); itr; ++itr)
+ {
+ typename Node::traits::data_type const& data = get(
+ *itr
+ , boost::tree_node::data_key()
+ );
+
+ if (1 < data)
+ {
+ for (std::size_t i = 0; i < data; ++i)
+ {
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ if (std::tr1::is_same<Selector,boost::slistS>::value)
+ (*itr).emplace(data - 1 - i);
+ else
+#endif
+ (*itr).emplace(i);
+ }
+ }
+ }
+}
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+template <typename DNode, typename ANode>
+void out_with_them(DNode const& d_node, ANode const& a_node)
+{
+ std::cout << std::endl << "#if defined BOOST_TREE_NODE_CAN_USE_FUSION";
+ iterator_out_bf_pre_post(a_node, output_node<boost::mpl::true_>(), 1);
+ iterator_out_df(a_node, output_tree<boost::mpl::true_>(2, 7, true));
+ std::cout << "#else // !defined BOOST_TREE_NODE_CAN_USE_FUSION";
+ iterator_out_bf_pre_post(d_node, output_node<boost::mpl::false_>(), 7);
+ iterator_out_df(d_node, output_tree<boost::mpl::false_>(2, 7, true));
+ std::cout << "#endif // BOOST_TREE_NODE_CAN_USE_FUSION" << std::endl;
+}
+
+template <typename FNode>
+void out_with_all(FNode const& f_node)
+{
+ iterator_out_bf_pre_post(f_node, output_uint_char_node(), 5);
+ iterator_out_df(f_node, output_uint_char_tree(2, 7, true));
+}
+#else // !defined BOOST_TREE_NODE_CAN_USE_FUSION
+template <typename DNode>
+void out_with_it(DNode const& d_node)
+{
+ iterator_out_bf_pre_post(d_node, output_node<boost::mpl::false_>(), 7);
+ iterator_out_df(d_node, output_tree<boost::mpl::false_>(2, 7, true));
+}
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+
+template <typename Selector>
+void example()
+{
+ typedef boost::tree_node::with_height<
+ boost::tree_node::with_position_base_gen<
+ boost::tree_node::with_count_base_gen<
+ boost::tree_node::nary_node_base_gen<Selector>
+ >
+ >
+ , boost::rational<long>
+ >
+ DNode;
+
+ DNode d_root(5);
+
+ initialize<Selector>(d_root);
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ typedef boost::tree_node::with_accumulation<
+ boost::tree_node::with_height_base_gen<
+ boost::tree_node::with_accumulation_base_gen<
+ boost::tree_node::with_position_base_gen<
+ boost::tree_node::with_accumulation_base_gen<
+ boost::tree_node::with_count_base_gen<
+ boost::tree_node::with_accumulation_base_gen<
+ boost::tree_node::nary_node_base_gen<Selector>
+ >
+ >
+ , AccuAccuKey
+ >
+ >
+ , AccuCountKey
+ >
+ >
+ , boost::rational<long>
+ , void
+ , AccuHeightKey
+ >
+ ANode;
+
+ ANode a_root(5);
+
+ initialize<Selector>(a_root);
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+
+ output_copyright_and_config_preamble();
+ std::cout << std::endl << "#include <iterator>";
+ output_header_and_type_preamble();
+ std::cout << "#include <boost/typeof/boost/tree_node/nary_node.hpp>";
+ std::cout << std::endl << std::endl << "template <typename Selector>";
+ std::cout << std::endl << "void test()" << std::endl << '{' << std::endl;
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ std::cout << "#if defined BOOST_TREE_NODE_CAN_USE_FUSION" << std::endl << (
+ " typedef boost::tree_node::with_accumulation<"
+ ) << std::endl << " boost::tree_node::with_height_base_gen<";
+ std::cout << std::endl << (
+ " boost::tree_node::with_accumulation_base_gen<"
+ ) << std::endl << (
+ " boost::tree_node::with_position_base_gen<"
+ ) << std::endl << (
+ " boost::tree_node::with_accumulation_base_gen<"
+ ) << std::endl << (
+ " boost::tree_node::with_count_base_gen<"
+ ) << std::endl << " boost";
+ std::cout << "::tree_node::with_accumulation_base_gen<" << std::endl << (
+ " boost::tree_node::nary_node_base_gen"
+ ) << "<Selector>" << std::endl << " >" << std::endl;
+ std::cout << " >" << std::endl;
+ std::cout << " , AccuAccuKey" << std::endl;
+ std::cout << " >" << std::endl;
+ std::cout << " >" << std::endl;
+ std::cout << " , AccuCountKey" << std::endl;
+ std::cout << " >" << std::endl << " >";
+ std::cout << std::endl << " , boost::rational<long>";
+ std::cout << std::endl << " , void" << std::endl;
+ std::cout << " , AccuHeightKey" << std::endl << " >";
+ std::cout << std::endl << " ANode;" << std::endl << (
+ "#else // !defined BOOST_TREE_NODE_CAN_USE_FUSION"
+ ) << std::endl;
+#endif // BOOST_NO_SFINAE
+ std::cout << " typedef boost::tree_node::with_height<" << std::endl << (
+ " boost::tree_node::with_position_base_gen<"
+ ) << std::endl << (
+ " boost::tree_node::with_count_base_gen<"
+ ) << std::endl << " " << (
+ "boost::tree_node::nary_node_base_gen<Selector>"
+ ) << std::endl << " >" << std::endl;
+ std::cout << " >" << std::endl;
+ std::cout << " , boost::rational<long>" << std::endl;
+ std::cout << " >" << std::endl;
+ std::cout << " ANode;" << std::endl;
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ std::cout << "#endif // BOOST_TREE_NODE_CAN_USE_FUSION" << std::endl;
+#endif
+ output_container_type_preamble();
+ std::cout << std::endl << " ANode a_root(5);" << std::endl;
+ std::cout << std::endl << " BOOST_CHECK(" << std::endl;
+ std::cout << " !a_root.get_parent_ptr()" << std::endl;
+ std::cout << "// , \"Parent member uninitialized.\"" << std::endl;
+ std::cout << " );" << std::endl << std::endl;
+ std::cout << " for (" << std::endl << (
+ " boost::tree_node::breadth_first_iterator<ANode> itr(a_root);"
+ ) << std::endl << " itr;" << std::endl << " ++itr";
+ std::cout << std::endl << " )" << std::endl << " {" << std::endl << (
+ " typename ANode::traits::data_type const& data = get("
+ ) << std::endl << " *itr" << std::endl;
+ std::cout << " , boost::tree_node::data_key()" << std::endl;
+ std::cout << " );" << std::endl << std::endl;
+ std::cout << " if (1 < data)";
+ std::cout << std::endl << " {" << std::endl;
+ std::cout << " for (std::size_t i = 0; i < data; ++i)";
+ std::cout << std::endl << " {" << std::endl << (
+ " typename ANode::iterator child_itr("
+ ) << std::endl << (
+ "#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION"
+ ) << std::endl << (
+ " (std::tr1::is_same<Selector,boost::slistS>::value"
+ ) << ") ? (" << std::endl;
+ std::cout << " (*itr).emplace(data - 1 - i)";
+ std::cout << std::endl << " ) :" << std::endl;
+ std::cout << "#endif" << std::endl;
+ std::cout << " (*itr).emplace(i)";
+ std::cout << std::endl << " );" << std::endl << (
+ " typename ANode::const_pointer const_child(&*child_itr"
+ ) << ");" << std::endl << " BOOST_CHECK(" << std::endl;
+ std::cout << " (*child_itr).get_parent_ptr() == &*itr";
+ std::cout << std::endl << (
+ "// , \"Ctor not linking child to parent.\""
+ ) << std::endl << " );" << std::endl;
+ std::cout << " BOOST_CHECK(" << std::endl;
+ std::cout << " (" << std::endl << (
+ " (*child_itr).get_parent_ptr()"
+ ) << std::endl << (
+ " ) == (*const_child).get_parent_ptr()"
+ ) << std::endl;
+ std::cout << "// , \"Why are these pointers different?\"";
+ std::cout << std::endl << " );" << std::endl << std::endl;
+ std::cout << " {" << std::endl << (
+ " typename ANode::iterator c_itr = (*itr).begin();"
+ ) << std::endl << std::endl << (
+ "#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION"
+ ) << std::endl << " " << (
+ "if (!std::tr1::is_same<Selector,boost::slistS>::value)"
+ ) << std::endl << "#endif" << std::endl;
+ std::cout << " std::advance(c_itr, i);" << std::endl;
+ std::cout << " BOOST_CHECK(" << std::endl;
+ std::cout << " &*child_itr == &*c_itr" << std::endl;
+ std::cout << "// " << (
+ ", \"Ctor not linking parent to child.\""
+ ) << std::endl << " );" << std::endl;
+ std::cout << " }" << std::endl << " }";
+ std::cout << std::endl << " }" << std::endl << " }";
+ std::cout << std::endl << std::endl << " {" << std::endl;
+ std::cout << " Values bf_vals, pre_vals, post_vals;";
+ std::cout << std::endl << " DFValues df_vals;" << std::endl;
+ std::cout << " Emplacer emplacer;" << std::endl;
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ out_with_them(d_root, a_root);
+#else
+ out_with_it(d_root);
+#endif
+ std::cout << " test_node<a_node_case>(a_root, bf_vals, pre_vals,";
+ std::cout << " post_vals, df_vals);" << std::endl;
+ std::cout << " }" << std::endl << std::endl;
+
+ {
+ typename DNode::iterator d_child_itr(
+ (*(++d_root.begin())).insert(d_root)
+ );
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ typename ANode::iterator a_child_itr(
+ (*(++a_root.begin())).insert(a_root)
+ );
+#endif
+
+ std::cout << " {" << std::endl << " ANode a_copy(a_root);";
+ std::cout << std::endl << (
+ " boost::tree_node::breadth_first_iterator<ANode const>"
+ ) << std::endl << (
+ " bf_root_itr(a_root), bf_copy_itr(a_copy);"
+ ) << std::endl << " boost::tree_node::breadth_first";
+ std::cout << "_descendant_iterator<ANode const>" << std::endl << (
+ " bf_d_root_itr(a_root), bf_d_copy_itr(a_copy);"
+ ) << std::endl << (
+ " boost::tree_node::pre_order_iterator<ANode const>"
+ ) << std::endl << (
+ " pre_root_itr(a_root), pre_copy_itr(a_copy);"
+ ) << std::endl << " boost::tree_node::pre_order";
+ std::cout << "_descendant_iterator<ANode const>" << std::endl << (
+ " pre_d_root_itr(a_root), pre_d_copy_itr(a_copy);"
+ ) << std::endl << (
+ " boost::tree_node::post_order_iterator<ANode const>"
+ ) << std::endl << (
+ " post_root_itr(a_root), post_copy_itr(a_copy);"
+ ) << std::endl << " boost::tree_node::post_order";
+ std::cout << "_descendant_iterator<ANode const>" << std::endl << (
+ " post_d_root_itr(a_root), post_d_copy_itr(a_copy);"
+ ) << std::endl << (
+ " boost::tree_node::depth_first_iterator<ANode const>"
+ ) << std::endl << (
+ " df_root_itr(a_root), df_copy_itr(a_copy);"
+ ) << std::endl << " boost::tree_node::depth_first";
+ std::cout << "_descendant_iterator<ANode const>" << std::endl << (
+ " df_d_root_itr(a_root), df_d_copy_itr(a_copy);"
+ ) << std::endl << std::endl << (
+ " BOOST_CHECK(test_node_copies(bf_root_itr, bf_copy_itr));"
+ ) << std::endl << " BOOST_CHECK(" << (
+ "test_node_copies(bf_d_root_itr, bf_d_copy_itr));"
+ ) << std::endl << " BOOST_CHECK(" << (
+ "test_node_copies(pre_root_itr, pre_copy_itr));"
+ ) << std::endl << " BOOST_CHECK(" << (
+ "test_node_copies(pre_d_root_itr, pre_d_copy_itr));"
+ ) << std::endl << " BOOST_CHECK(" << (
+ "test_node_copies(post_root_itr, post_copy_itr));"
+ ) << std::endl << " BOOST_CHECK(" << (
+ "test_node_copies(post_d_root_itr, post_d_copy_itr));"
+ ) << std::endl << (
+ " BOOST_CHECK(test_node_copies(df_root_itr, df_copy_itr));"
+ ) << std::endl << " BOOST_CHECK(" << (
+ "test_node_copies(df_d_root_itr, df_d_copy_itr));"
+ ) << std::endl << " }" << std::endl << std::endl << " {";
+ std::cout << std::endl << (
+ " typename ANode::iterator a_child_itr("
+ ) << std::endl << " (*(++a_root.begin())).insert(a_root)";
+ std::cout << std::endl << " );" << std::endl;
+ std::cout << " Values bf_vals, pre_vals, post_vals;";
+ std::cout << std::endl << " DFValues df_vals;" << std::endl;
+ std::cout << " Emplacer emplacer;" << std::endl;
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ out_with_them(d_root, a_root);
+#else
+ out_with_it(d_root);
+#endif
+ std::cout << " test_node<a_node_case>(a_root, bf_vals, pre_";
+ std::cout << "vals, post_vals, df_vals);" << std::endl << std::endl;
+
+ d_root = *d_child_itr;
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ a_root = *a_child_itr;
+#endif
+ std::cout << " a_root = *a_child_itr;" << std::endl;
+ std::cout << " bf_vals.clear();" << std::endl;
+ std::cout << " pre_vals.clear();" << std::endl;
+ std::cout << " post_vals.clear();" << std::endl;
+ std::cout << " df_vals.clear();" << std::endl;
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ out_with_them(d_root, a_root);
+#else
+ out_with_it(d_root);
+#endif
+ std::cout << " test_node<a_node_case>(a_root, bf_vals, pre_";
+ std::cout << "vals, post_vals, df_vals);" << std::endl << std::endl;
+
+ d_child_itr = d_root.begin();
+ std::advance(d_child_itr, 4);
+ d_child_itr = (*d_child_itr).begin();
+ *d_child_itr = d_root;
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ a_child_itr = a_root.begin();
+ std::advance(a_child_itr, 4);
+ a_child_itr = (*a_child_itr).begin();
+ *a_child_itr = a_root;
+#endif
+ std::cout << " a_child_itr = a_root.begin();" << std::endl;
+ std::cout << " std::advance(a_child_itr, 4);" << std::endl;
+ std::cout << " a_child_itr = (*a_child_itr).begin();";
+ std::cout << std::endl << " *a_child_itr = a_root;";
+ std::cout << std::endl << " test_node<a_node_case>";
+ std::cout << "(*a_child_itr, bf_vals, pre_vals, post_vals, df_vals);";
+ std::cout << std::endl << std::endl << " bf_vals.clear();";
+ std::cout << std::endl << " pre_vals.clear();" << std::endl;
+ std::cout << " post_vals.clear();" << std::endl;
+ std::cout << " df_vals.clear();" << std::endl;
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ out_with_them(d_root, a_root);
+#else
+ out_with_it(d_root);
+#endif
+ std::cout << " test_node<a_node_case>(a_root, bf_vals, pre_";
+ std::cout << "vals, post_vals, df_vals);" << std::endl << std::endl;
+
+ d_child_itr = (*d_child_itr).begin();
+ std::advance(d_child_itr, 2);
+
+ typename DNode::iterator d_desc_itr = d_child_itr;
+ typename DNode::iterator d_src_itr = (*(++d_desc_itr)).begin();
+ typename DNode::iterator d_end_itr = (*d_desc_itr).end();
+
+ (*d_child_itr).splice(
+ ++(*d_child_itr).begin()
+ , *d_desc_itr
+ , ++d_src_itr
+ , d_end_itr
+ );
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ a_child_itr = (*a_child_itr).begin();
+ std::advance(a_child_itr, 2);
+
+ typename ANode::iterator a_desc_itr = a_child_itr;
+ typename ANode::iterator a_src_itr = (*(++a_desc_itr)).begin();
+ typename ANode::iterator a_end_itr = (*a_desc_itr).end();
+
+ (*a_child_itr).splice(
+ ++(*a_child_itr).begin()
+ , *a_desc_itr
+ , ++a_src_itr
+ , a_end_itr
+ );
+#endif
+ std::cout << " a_child_itr = (*a_child_itr).begin();";
+ std::cout << std::endl << " std::advance(a_child_itr, 2);";
+ std::cout << std::endl << std::endl << " typename ANode::";
+ std::cout << "iterator a_desc_itr = a_child_itr;" << std::endl;
+ std::cout << " typename ANode::iterator a_src_itr";
+ std::cout << " = (*(++a_desc_itr)).begin();" << std::endl;
+ std::cout << " typename ANode::iterator a_end_itr";
+ std::cout << " = (*a_desc_itr).end();" << std::endl << std::endl;
+ std::cout << " (*a_child_itr).splice(" << std::endl;
+ std::cout << " ++(*a_child_itr).begin()" << std::endl;
+ std::cout << " , *a_desc_itr" << std::endl;
+ std::cout << " , ++a_src_itr" << std::endl;
+ std::cout << " , a_end_itr" << std::endl << " );";
+ std::cout << std::endl << " bf_vals.clear();" << std::endl;
+ std::cout << " pre_vals.clear();" << std::endl;
+ std::cout << " post_vals.clear();" << std::endl;
+ std::cout << " df_vals.clear();" << std::endl;
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ out_with_them(d_root, a_root);
+#else
+ out_with_it(d_root);
+#endif
+
+#if defined __BOOST_TEST_TREE_NODE_TEST_SPLICE_ONE_ELEMENT__
+ std::cout << " test_node<a_node_case>(a_root, bf_vals, pre_";
+ std::cout << "vals, post_vals, df_vals);" << std::endl << std::endl;
+
+ d_child_itr = d_root.begin();
+ std::advance(d_child_itr, 2);
+ d_desc_itr = d_child_itr;
+ d_src_itr = (*(++d_desc_itr)).begin();
+ (*d_child_itr).splice(
+ ++(*d_child_itr).begin()
+ , *d_desc_itr
+ , ++d_src_itr
+ );
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ a_child_itr = a_root.begin();
+ std::advance(a_child_itr, 2);
+ a_desc_itr = a_child_itr;
+ a_src_itr = (*(++a_desc_itr)).begin();
+ (*a_child_itr).splice(
+ ++(*a_child_itr).begin()
+ , *a_desc_itr
+ , ++a_src_itr
+ );
+#endif
+ std::cout << " a_child_itr = a_root.begin();" << std::endl;
+ std::cout << " std::advance(a_child_itr, 2);" << std::endl;
+ std::cout << " a_desc_itr = a_child_itr;" << std::endl;
+ std::cout << " a_src_itr = (*(++a_desc_itr)).begin();";
+ std::cout << std::endl << " (*a_child_itr).splice(";
+ std::cout << std::endl << " ++(*a_child_itr).begin()";
+ std::cout << std::endl << " , *a_desc_itr" << std::endl;
+ std::cout << " , ++a_src_itr" << std::endl;
+ std::cout << " );" << std::endl << " bf_vals.clear();";
+ std::cout << std::endl << " pre_vals.clear();" << std::endl;
+ std::cout << " post_vals.clear();" << std::endl;
+ std::cout << " df_vals.clear();" << std::endl;
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ out_with_them(d_root, a_root);
+#else
+ out_with_it(d_root);
+#endif
+#endif // __BOOST_TEST_TREE_NODE_TEST_SPLICE_ONE_ELEMENT__
+
+ std::cout << " test_node<a_node_case>(a_root, bf_vals, pre_";
+ std::cout << "vals, post_vals, df_vals);" << std::endl;
+ std::cout << " }" << std::endl << std::endl;
+ }
+
+ {
+ typename DNode::iterator d_child_itr(d_root.begin());
+
+ std::advance(d_child_itr, 3);
+ (*d_child_itr).clear();
+ }
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ {
+ typename ANode::iterator a_child_itr(a_root.begin());
+
+ std::advance(a_child_itr, 3);
+ (*a_child_itr).clear();
+ }
+#endif
+
+ std::cout << " {" << std::endl << (
+ " typename ANode::iterator a_child_itr(a_root.begin());"
+ ) << std::endl << std::endl << " std::advance(a_child_itr, 3);";
+ std::cout << std::endl << " (*a_child_itr).clear();" << std::endl;
+ std::cout << std::endl << " Values bf_vals, pre_vals, post_vals;";
+ std::cout << std::endl << " DFValues df_vals;" << std::endl;
+ std::cout << " Emplacer emplacer;" << std::endl;
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ out_with_them(d_root, a_root);
+#else
+ out_with_it(d_root);
+#endif
+ std::cout << " test_node<a_node_case>(a_root, bf_vals, pre_vals,";
+ std::cout << " post_vals, df_vals);" << std::endl << " }" << std::endl;
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ typedef boost::tree_node::with_accumulation<
+ boost::tree_node::nary_node_base_gen<Selector>
+ , DataMap
+ , void
+ , AccuYourUintKey
+ >
+ FNode;
+
+ FNode f_root(
+ boost::fusion::make_pair<example_keys::your_uint>(5)
+ , boost::fusion::make_pair<example_keys::your_char>('5')
+ );
+
+ for (
+ boost::tree_node::breadth_first_iterator<FNode> itr(f_root);
+ itr;
+ ++itr
+ )
+ {
+ typename boost::tree_node::result_of::value_at_key<
+ FNode const
+ , example_keys::your_uint
+ >::type data = boost::tree_node::get<example_keys::your_uint>(*itr);
+
+ if (1 < data)
+ {
+ for (unsigned int i = 0; i < data; ++i)
+ {
+ if (std::tr1::is_same<Selector,boost::slistS>::value)
+ {
+ (*itr).emplace(
+ boost::fusion::make_pair<example_keys::your_uint>(
+ data - 1 - i
+ )
+ , boost::fusion::make_pair<example_keys::your_char>(
+ '0' + data - 1 - i
+ )
+ );
+ }
+ else
+ {
+ (*itr).emplace(
+ boost::fusion::make_pair<example_keys::your_uint>(i)
+ , boost::fusion::make_pair<example_keys::your_char>(
+ '0' + i
+ )
+ );
+ }
+ }
+ }
+ }
+
+ std::cout << std::endl << "#if defined BOOST_TREE_NODE_CAN_USE_FUSION";
+ std::cout << std::endl << (
+ " typedef boost::tree_node::with_accumulation<"
+ ) << std::endl << (
+ " boost::tree_node::nary_node_base_gen<Selector>"
+ ) << std::endl << " , DataMap" << std::endl;
+ std::cout << " , void" << std::endl;
+ std::cout << " , AccuYourUintKey" << std::endl;
+ std::cout << " >" << std::endl << " FNode;";
+ output_container_fused_type_preamble();
+ std::cout << std::endl << " FNode f_root(" << std::endl << (
+ " boost::fusion::make_pair<example_keys::your_uint>(5)"
+ ) << std::endl << (
+ " , boost::fusion::make_pair<example_keys::your_char>(\'5\')"
+ ) << std::endl << " );" << std::endl << std::endl;
+ std::cout << " for (" << std::endl << (
+ " boost::tree_node::breadth_first_iterator<FNode> itr(f_root);"
+ ) << std::endl << " itr;" << std::endl << " ++itr";
+ std::cout << std::endl << " )" << std::endl << " {" << std::endl;
+ std::cout << " typename boost::tree_node::result_of::value_at_key<";
+ std::cout << std::endl << " FNode const" << std::endl;
+ std::cout << " , example_keys::your_uint" << std::endl << (
+ " >::type data = boost::tree_node::get<example_keys::your_uint>"
+ ) << "(*itr);" << std::endl << std::endl;
+ std::cout << " if (1 < data)" << std::endl << " {";
+ std::cout << std::endl << (
+ " for (unsigned int i = 0; i < data; ++i)"
+ ) << std::endl << " {" << std::endl << (
+ " if (std::tr1::is_same<Selector,boost::slistS>::value)"
+ ) << std::endl << " {" << std::endl;
+ std::cout << " (*itr).emplace(" << std::endl << (
+ " boost::fusion::make_pair<example_keys::your_"
+ ) << "uint>(" << std::endl << " data - 1 - i";
+ std::cout << std::endl << " )" << std::endl << (
+ " , boost::fusion::make_pair<example_keys::your_"
+ ) << "char>(" << std::endl << (
+ " \'0\' + data - 1 - i"
+ ) << std::endl << " )" << std::endl;
+ std::cout << " );" << std::endl << " }";
+ std::cout << std::endl << " else" << std::endl;
+ std::cout << " {" << std::endl;
+ std::cout << " (*itr).emplace(" << std::endl << (
+ " boost::fusion::make_pair<example_keys::your_"
+ ) << "uint>(i)" << std::endl << " , boost::" << (
+ "fusion::make_pair<example_keys::your_char>("
+ ) << std::endl << " \'0\' + i" << std::endl;
+ std::cout << " )" << std::endl;
+ std::cout << " );" << std::endl;
+ std::cout << " }" << std::endl;
+ std::cout << " }" << std::endl;
+ std::cout << std::endl << " }" << std::endl << " }" << std::endl;
+ std::cout << std::endl << " {" << std::endl;
+ std::cout << " MoreValues bf_vals, pre_vals, post_vals;";
+ std::cout << std::endl << " DFMoreValues df_vals;" << std::endl;
+ std::cout << " Emplacer emplacer;" << std::endl;
+ out_with_all(f_root);
+ std::cout << " test_node<f_node_case>(f_root, bf_vals, pre_vals,";
+ std::cout << " post_vals, df_vals);" << std::endl << std::endl << (
+ " typename FNode::iterator f_child_itr(f_root.begin());"
+ ) << std::endl << std::endl << " std::advance(f_child_itr, 3);";
+ std::cout << std::endl << " f_child_itr = (*f_child_itr).begin();";
+ std::cout << std::endl << " std::advance(f_child_itr, 2);";
+ std::cout << std::endl << " " << (
+ "boost::tree_node::put(*f_child_itr, example_keys::your_uint(), 7);"
+ ) << std::endl << " bf_vals.clear();" << std::endl;
+ std::cout << " pre_vals.clear();" << std::endl;
+ std::cout << " post_vals.clear();" << std::endl;
+ std::cout << " df_vals.clear();" << std::endl;
+
+ {
+ typename FNode::iterator f_child_itr(f_root.begin());
+
+ std::advance(f_child_itr, 3);
+ f_child_itr = (*f_child_itr).begin();
+ std::advance(f_child_itr, 2);
+ put(*f_child_itr, example_keys::your_uint(), 7);
+ }
+
+ out_with_all(f_root);
+ std::cout << " test_node<f_node_case>(f_root, bf_vals, pre_vals,";
+ std::cout << " post_vals, df_vals);" << std::endl << " }" << std::endl;
+ std::cout << "#endif // BOOST_TREE_NODE_CAN_USE_FUSION" << std::endl;
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+
+ std::cout << '}' << std::endl << std::endl << "#if defined BOOST_MSVC";
+ std::cout << std::endl << " #pragma warning (pop)" << std::endl;
+ std::cout << "#endif" << std::endl << std::endl;
+ std::cout << "#if defined BOOST_TYPEOF_EMULATION" << std::endl << (
+ "#include <boost/typeof/boost/ptr_container/ptr_vector.hpp>"
+ ) << std::endl << (
+ "#include <boost/typeof/boost/ptr_container/ptr_deque.hpp>"
+ ) << std::endl << (
+ "#include <boost/typeof/boost/ptr_container/ptr_list.hpp>"
+ ) << std::endl << "#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION";
+ std::cout << std::endl << (
+ "#include <boost/typeof/boost/container/vector.hpp>"
+ ) << std::endl << (
+ "#include <boost/typeof/boost/container/stable_vector.hpp>"
+ ) << std::endl << "#include <boost/typeof/boost/container/deque.hpp>";
+ std::cout << std::endl << (
+ "#include <boost/typeof/boost/container/list.hpp>"
+ ) << std::endl << "#include <boost/typeof/boost/container/slist.hpp>";
+ std::cout << std::endl << (
+ "#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION"
+ ) << std::endl << "#endif // BOOST_TYPEOF_EMULATION" << std::endl;
+ std::cout << std::endl << "int test_main(int argc, char** argv)";
+ std::cout << std::endl << '{' << std::endl;
+ std::cout << " test<boost::ptr_vecS>();" << std::endl;
+ std::cout << " test<boost::ptr_dequeS>();" << std::endl;
+ std::cout << " test<boost::ptr_listS>();" << std::endl << (
+ "#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION"
+ ) << std::endl << (
+ " test<boost::vector_selector<boost::mpl::true_> >();"
+ ) << std::endl << "// test<boost::stable_vecS>();" << std::endl;
+ std::cout << "// test<boost::deque_selector<boost::mpl::true_> >();";
+ std::cout << std::endl << (
+ " test<boost::list_selector<boost::mpl::true_> >();"
+ ) << std::endl << " test<boost::slistS>();" << std::endl;
+ std::cout << "#endif" << std::endl << std::endl;
+ std::cout << " return 0;" << std::endl << '}' << std::endl << std::endl;
+}
+
+#if defined BOOST_TYPEOF_EMULATION
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/typeof/boost/ptr_container/ptr_vector.hpp>
+#elif defined __BOOST_TEST_TREE_NODE_TEST_CONTAINER_DEQUE__
+#include <boost/typeof/boost/mpl/bool.hpp>
+#include <boost/typeof/boost/container/deque.hpp>
+#elif defined __BOOST_TEST_TREE_NODE_TEST_STABLE_VECTOR__
+#include <boost/typeof/boost/container/stable_vector.hpp>
+#else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/typeof/boost/container/slist.hpp>
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#endif // BOOST_TYPEOF_EMULATION
+
+int main()
+{
+#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ example<boost::ptr_vecS>();
+#elif defined __BOOST_TEST_TREE_NODE_TEST_CONTAINER_DEQUE__
+ example<boost::deque_selector<boost::mpl::true_> >();
+#elif defined __BOOST_TEST_TREE_NODE_TEST_STABLE_VECTOR__
+ example<boost::stable_vecS>();
+#else
+ example<boost::slistS>();
+#endif
+ return 0;
+}
+

Added: sandbox/tree_node/libs/tree_node/test/nary_node.cpp
==============================================================================
--- (empty file)
+++ sandbox/tree_node/libs/tree_node/test/nary_node.cpp 2013-03-11 00:49:15 EDT (Mon, 11 Mar 2013)
@@ -0,0 +1,2847 @@
+// Copyright (C) 2012-2013 Cromwell D. Enage
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <boost/config.hpp>
+
+#if defined BOOST_MSVC
+ #pragma warning (push)
+ #pragma warning (disable : 4996) // fn called w/params that may be unsafe
+#endif
+
+#include <iterator>
+#include <boost/tuple/tuple.hpp>
+#include <boost/typeof/boost/rational.hpp>
+#include <boost/typeof/boost/container_gen/selectors.hpp>
+#include <boost/container_gen/container_gen.hpp>
+#include <boost/container_gen/emplace_function_gen.hpp>
+#include <boost/tree_node/preprocessor.hpp>
+#include <boost/tree_node/intrinsic/value_at_key.hpp>
+#include <boost/typeof/boost/tree_node/with_count.hpp>
+#include <boost/typeof/boost/tree_node/with_height.hpp>
+#include <boost/typeof/boost/tree_node/with_position.hpp>
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+#include <boost/typeof/boost/tree_node/with_accumulation.hpp>
+#endif
+
+#include "../example/type_definitions.hpp"
+#include "iterator_functions.hpp"
+
+typedef boost::emplace_function_gen<boost::dequeS>::type
+ Emplacer;
+
+#include <boost/typeof/boost/tree_node/nary_node.hpp>
+
+template <typename Selector>
+void test()
+{
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ typedef boost::tree_node::with_accumulation<
+ boost::tree_node::with_height_base_gen<
+ boost::tree_node::with_accumulation_base_gen<
+ boost::tree_node::with_position_base_gen<
+ boost::tree_node::with_accumulation_base_gen<
+ boost::tree_node::with_count_base_gen<
+ boost::tree_node::with_accumulation_base_gen<
+ boost::tree_node::nary_node_base_gen<Selector>
+ >
+ >
+ , AccuAccuKey
+ >
+ >
+ , AccuCountKey
+ >
+ >
+ , boost::rational<long>
+ , void
+ , AccuHeightKey
+ >
+ ANode;
+#else // !defined BOOST_TREE_NODE_CAN_USE_FUSION
+ typedef boost::tree_node::with_height<
+ boost::tree_node::with_position_base_gen<
+ boost::tree_node::with_count_base_gen<
+ boost::tree_node::nary_node_base_gen<Selector>
+ >
+ >
+ , boost::rational<long>
+ >
+ ANode;
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+
+ typedef typename boost::container_gen<
+ boost::dequeS
+ , boost::tuples::tuple<
+ typename boost::tree_node::result_of::value_at_key<
+ ANode const
+ , boost::tree_node::data_key
+ >::type
+ , typename boost::tree_node::result_of::value_at_key<
+ ANode const
+ , boost::tree_node::height_key
+ >::type
+ , typename boost::tree_node::result_of::value_at_key<
+ ANode const
+ , boost::tree_node::count_key
+ >::type
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ , typename boost::tree_node::result_of::value_at_key<
+ ANode const
+ , boost::tree_node::accumulation_key<>
+ >::type
+ , typename boost::tree_node::result_of::value_at_key<
+ ANode const
+ , AccuHeightKey
+ >::type
+ , typename boost::tree_node::result_of::value_at_key<
+ ANode const
+ , AccuCountKey
+ >::type
+ , typename boost::tree_node::result_of::value_at_key<
+ ANode const
+ , AccuAccuKey
+ >::type
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+ >
+ >::type
+ Values;
+ typedef typename boost::container_gen<
+ boost::dequeS
+ , boost::tuples::tuple<
+ boost::tree_node::traversal_state
+ , typename boost::tree_node::result_of::value_at_key<
+ ANode const
+ , boost::tree_node::data_key
+ >::type
+ , typename boost::tree_node::result_of::value_at_key<
+ ANode const
+ , boost::tree_node::height_key
+ >::type
+ , typename boost::tree_node::result_of::value_at_key<
+ ANode const
+ , boost::tree_node::count_key
+ >::type
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ , typename boost::tree_node::result_of::value_at_key<
+ ANode const
+ , boost::tree_node::accumulation_key<>
+ >::type
+ , typename boost::tree_node::result_of::value_at_key<
+ ANode const
+ , AccuHeightKey
+ >::type
+ , typename boost::tree_node::result_of::value_at_key<
+ ANode const
+ , AccuCountKey
+ >::type
+ , typename boost::tree_node::result_of::value_at_key<
+ ANode const
+ , AccuAccuKey
+ >::type
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+ >
+ >::type
+ DFValues;
+
+ ANode a_root(5);
+
+ BOOST_CHECK(
+ !a_root.get_parent_ptr()
+// , "Parent member uninitialized."
+ );
+
+ for (
+ boost::tree_node::breadth_first_iterator<ANode> itr(a_root);
+ itr;
+ ++itr
+ )
+ {
+ typename ANode::traits::data_type const& data = get(
+ *itr
+ , boost::tree_node::data_key()
+ );
+
+ if (1 < data)
+ {
+ for (std::size_t i = 0; i < data; ++i)
+ {
+ typename ANode::iterator child_itr(
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ (std::tr1::is_same<Selector,boost::slistS>::value) ? (
+ (*itr).emplace(data - 1 - i)
+ ) :
+#endif
+ (*itr).emplace(i)
+ );
+ typename ANode::const_pointer const_child(&*child_itr);
+ BOOST_CHECK(
+ (*child_itr).get_parent_ptr() == &*itr
+// , "Ctor not linking child to parent."
+ );
+ BOOST_CHECK(
+ (
+ (*child_itr).get_parent_ptr()
+ ) == (*const_child).get_parent_ptr()
+// , "Why are these pointers different?"
+ );
+
+ {
+ typename ANode::iterator c_itr = (*itr).begin();
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ if (!std::tr1::is_same<Selector,boost::slistS>::value)
+#endif
+ std::advance(c_itr, i);
+ BOOST_CHECK(
+ &*child_itr == &*c_itr
+// , "Ctor not linking parent to child."
+ );
+ }
+ }
+ }
+ }
+
+ {
+ Values bf_vals, pre_vals, post_vals;
+ DFValues df_vals;
+ Emplacer emplacer;
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ emplacer[bf_vals]
+ (5, 4, 24, 31, 3, 76, boost::rational<long>(10, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1));
+ emplacer[pre_vals]
+ (5, 4, 24, 31, 3, 76, boost::rational<long>(10, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1));
+ emplacer[post_vals]
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (5, 4, 24, 31, 3, 76, boost::rational<long>(10, 3));
+ emplacer[df_vals]
+ (boost::tree_node::pre_order_traversal, 5, 4, 24,
+ 31, 3, 76, boost::rational<long>(10, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::post_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 4, 3, 12,
+ 15, 2, 32, boost::rational<long>(8, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::post_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::post_order_traversal, 4, 3, 12,
+ 15, 2, 32, boost::rational<long>(8, 3))
+ (boost::tree_node::post_order_traversal, 5, 4, 24,
+ 31, 3, 76, boost::rational<long>(10, 3));
+#else // !defined BOOST_TREE_NODE_CAN_USE_FUSION
+ emplacer[bf_vals]
+ (5, 4, 24)(0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 2, 6)(4, 3, 12)(0, 0, 1)
+ (1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(2, 1, 3)
+ (3, 2, 6)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)
+ (2, 1, 3)(0, 0, 1)(1, 0, 1);
+ emplacer[pre_vals]
+ (5, 4, 24)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(3, 2, 6)
+ (0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(4, 3, 12)(0, 0, 1)
+ (1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(3, 2, 6)(0, 0, 1)(1, 0, 1)
+ (2, 1, 3)(0, 0, 1)(1, 0, 1);
+ emplacer[post_vals]
+ (0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)
+ (0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 2, 6)(0, 0, 1)(1, 0, 1)(0, 0, 1)
+ (1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)
+ (3, 2, 6)(4, 3, 12)(5, 4, 24);
+ emplacer[df_vals]
+ (boost::tree_node::pre_order_traversal, 5, 4, 24)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::post_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 4, 3, 12)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::post_order_traversal, 3, 2, 6)
+ (boost::tree_node::post_order_traversal, 4, 3, 12)
+ (boost::tree_node::post_order_traversal, 5, 4, 24);
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+ test_node<a_node_case>(a_root, bf_vals, pre_vals, post_vals, df_vals);
+ }
+
+ {
+ ANode a_copy(a_root);
+ boost::tree_node::breadth_first_iterator<ANode const>
+ bf_root_itr(a_root), bf_copy_itr(a_copy);
+ boost::tree_node::breadth_first_descendant_iterator<ANode const>
+ bf_d_root_itr(a_root), bf_d_copy_itr(a_copy);
+ boost::tree_node::pre_order_iterator<ANode const>
+ pre_root_itr(a_root), pre_copy_itr(a_copy);
+ boost::tree_node::pre_order_descendant_iterator<ANode const>
+ pre_d_root_itr(a_root), pre_d_copy_itr(a_copy);
+ boost::tree_node::post_order_iterator<ANode const>
+ post_root_itr(a_root), post_copy_itr(a_copy);
+ boost::tree_node::post_order_descendant_iterator<ANode const>
+ post_d_root_itr(a_root), post_d_copy_itr(a_copy);
+ boost::tree_node::depth_first_iterator<ANode const>
+ df_root_itr(a_root), df_copy_itr(a_copy);
+ boost::tree_node::depth_first_descendant_iterator<ANode const>
+ df_d_root_itr(a_root), df_d_copy_itr(a_copy);
+
+ BOOST_CHECK(test_node_copies(bf_root_itr, bf_copy_itr));
+ BOOST_CHECK(test_node_copies(bf_d_root_itr, bf_d_copy_itr));
+ BOOST_CHECK(test_node_copies(pre_root_itr, pre_copy_itr));
+ BOOST_CHECK(test_node_copies(pre_d_root_itr, pre_d_copy_itr));
+ BOOST_CHECK(test_node_copies(post_root_itr, post_copy_itr));
+ BOOST_CHECK(test_node_copies(post_d_root_itr, post_d_copy_itr));
+ BOOST_CHECK(test_node_copies(df_root_itr, df_copy_itr));
+ BOOST_CHECK(test_node_copies(df_d_root_itr, df_d_copy_itr));
+ }
+
+ {
+ typename ANode::iterator a_child_itr(
+ (*(++a_root.begin())).insert(a_root)
+ );
+ Values bf_vals, pre_vals, post_vals;
+ DFValues df_vals;
+ Emplacer emplacer;
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ emplacer[bf_vals]
+ (5, 6, 48, 62, 5, 200, boost::rational<long>(37, 8))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 5, 25, 32, 4, 101, boost::rational<long>(112, 25))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (5, 4, 24, 31, 3, 76, boost::rational<long>(10, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1));
+ emplacer[pre_vals]
+ (5, 6, 48, 62, 5, 200, boost::rational<long>(37, 8))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 5, 25, 32, 4, 101, boost::rational<long>(112, 25))
+ (5, 4, 24, 31, 3, 76, boost::rational<long>(10, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1));
+ emplacer[post_vals]
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (5, 4, 24, 31, 3, 76, boost::rational<long>(10, 3))
+ (1, 5, 25, 32, 4, 101, boost::rational<long>(112, 25))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (5, 6, 48, 62, 5, 200, boost::rational<long>(37, 8));
+ emplacer[df_vals]
+ (boost::tree_node::pre_order_traversal, 5, 6, 48,
+ 62, 5, 200, boost::rational<long>(37, 8))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 5, 25,
+ 32, 4, 101, boost::rational<long>(112, 25))
+ (boost::tree_node::pre_order_traversal, 5, 4, 24,
+ 31, 3, 76, boost::rational<long>(10, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::post_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 4, 3, 12,
+ 15, 2, 32, boost::rational<long>(8, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::post_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::post_order_traversal, 4, 3, 12,
+ 15, 2, 32, boost::rational<long>(8, 3))
+ (boost::tree_node::post_order_traversal, 5, 4, 24,
+ 31, 3, 76, boost::rational<long>(10, 3))
+ (boost::tree_node::post_order_traversal, 1, 5, 25,
+ 32, 4, 101, boost::rational<long>(112, 25))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::post_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 4, 3, 12,
+ 15, 2, 32, boost::rational<long>(8, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::post_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::post_order_traversal, 4, 3, 12,
+ 15, 2, 32, boost::rational<long>(8, 3))
+ (boost::tree_node::post_order_traversal, 5, 6, 48,
+ 62, 5, 200, boost::rational<long>(37, 8));
+#else // !defined BOOST_TREE_NODE_CAN_USE_FUSION
+ emplacer[bf_vals]
+ (5, 6, 48)(0, 0, 1)(1, 5, 25)(2, 1, 3)(3, 2, 6)(4, 3, 12)(5, 4, 24)
+ (0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)
+ (2, 1, 3)(3, 2, 6)(0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 2, 6)(4, 3, 12)
+ (0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)
+ (0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)
+ (2, 1, 3)(3, 2, 6)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(0, 0, 1)
+ (1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1);
+ emplacer[pre_vals]
+ (5, 6, 48)(0, 0, 1)(1, 5, 25)(5, 4, 24)(0, 0, 1)(1, 0, 1)(2, 1, 3)
+ (0, 0, 1)(1, 0, 1)(3, 2, 6)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)
+ (1, 0, 1)(4, 3, 12)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)
+ (3, 2, 6)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(2, 1, 3)
+ (0, 0, 1)(1, 0, 1)(3, 2, 6)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)
+ (1, 0, 1)(4, 3, 12)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)
+ (3, 2, 6)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1);
+ emplacer[post_vals]
+ (0, 0, 1)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)
+ (1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 2, 6)(0, 0, 1)(1, 0, 1)
+ (0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)
+ (2, 1, 3)(3, 2, 6)(4, 3, 12)(5, 4, 24)(1, 5, 25)(0, 0, 1)(1, 0, 1)
+ (2, 1, 3)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 2, 6)
+ (0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)
+ (0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 2, 6)(4, 3, 12)(5, 6, 48);
+ emplacer[df_vals]
+ (boost::tree_node::pre_order_traversal, 5, 6, 48)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 5, 25)
+ (boost::tree_node::pre_order_traversal, 5, 4, 24)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::post_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 4, 3, 12)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::post_order_traversal, 3, 2, 6)
+ (boost::tree_node::post_order_traversal, 4, 3, 12)
+ (boost::tree_node::post_order_traversal, 5, 4, 24)
+ (boost::tree_node::post_order_traversal, 1, 5, 25)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::post_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 4, 3, 12)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::post_order_traversal, 3, 2, 6)
+ (boost::tree_node::post_order_traversal, 4, 3, 12)
+ (boost::tree_node::post_order_traversal, 5, 6, 48);
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+ test_node<a_node_case>(a_root, bf_vals, pre_vals, post_vals, df_vals);
+
+ a_root = *a_child_itr;
+ bf_vals.clear();
+ pre_vals.clear();
+ post_vals.clear();
+ df_vals.clear();
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ emplacer[bf_vals]
+ (5, 4, 24, 31, 3, 76, boost::rational<long>(10, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1));
+ emplacer[pre_vals]
+ (5, 4, 24, 31, 3, 76, boost::rational<long>(10, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1));
+ emplacer[post_vals]
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (5, 4, 24, 31, 3, 76, boost::rational<long>(10, 3));
+ emplacer[df_vals]
+ (boost::tree_node::pre_order_traversal, 5, 4, 24,
+ 31, 3, 76, boost::rational<long>(10, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::post_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 4, 3, 12,
+ 15, 2, 32, boost::rational<long>(8, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::post_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::post_order_traversal, 4, 3, 12,
+ 15, 2, 32, boost::rational<long>(8, 3))
+ (boost::tree_node::post_order_traversal, 5, 4, 24,
+ 31, 3, 76, boost::rational<long>(10, 3));
+#else // !defined BOOST_TREE_NODE_CAN_USE_FUSION
+ emplacer[bf_vals]
+ (5, 4, 24)(0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 2, 6)(4, 3, 12)(0, 0, 1)
+ (1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(2, 1, 3)
+ (3, 2, 6)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)
+ (2, 1, 3)(0, 0, 1)(1, 0, 1);
+ emplacer[pre_vals]
+ (5, 4, 24)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(3, 2, 6)
+ (0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(4, 3, 12)(0, 0, 1)
+ (1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(3, 2, 6)(0, 0, 1)(1, 0, 1)
+ (2, 1, 3)(0, 0, 1)(1, 0, 1);
+ emplacer[post_vals]
+ (0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)
+ (0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 2, 6)(0, 0, 1)(1, 0, 1)(0, 0, 1)
+ (1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)
+ (3, 2, 6)(4, 3, 12)(5, 4, 24);
+ emplacer[df_vals]
+ (boost::tree_node::pre_order_traversal, 5, 4, 24)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::post_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 4, 3, 12)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::post_order_traversal, 3, 2, 6)
+ (boost::tree_node::post_order_traversal, 4, 3, 12)
+ (boost::tree_node::post_order_traversal, 5, 4, 24);
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+ test_node<a_node_case>(a_root, bf_vals, pre_vals, post_vals, df_vals);
+
+ a_child_itr = a_root.begin();
+ std::advance(a_child_itr, 4);
+ a_child_itr = (*a_child_itr).begin();
+ *a_child_itr = a_root;
+ test_node<a_node_case>(*a_child_itr, bf_vals, pre_vals, post_vals, df_vals);
+
+ bf_vals.clear();
+ pre_vals.clear();
+ post_vals.clear();
+ df_vals.clear();
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ emplacer[bf_vals]
+ (5, 6, 47, 62, 5, 197, boost::rational<long>(222, 47))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (4, 5, 35, 46, 4, 130, boost::rational<long>(143, 35))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (5, 4, 24, 31, 3, 76, boost::rational<long>(10, 3))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1));
+ emplacer[pre_vals]
+ (5, 6, 47, 62, 5, 197, boost::rational<long>(222, 47))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (4, 5, 35, 46, 4, 130, boost::rational<long>(143, 35))
+ (5, 4, 24, 31, 3, 76, boost::rational<long>(10, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1));
+ emplacer[post_vals]
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (5, 4, 24, 31, 3, 76, boost::rational<long>(10, 3))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (4, 5, 35, 46, 4, 130, boost::rational<long>(143, 35))
+ (5, 6, 47, 62, 5, 197, boost::rational<long>(222, 47));
+ emplacer[df_vals]
+ (boost::tree_node::pre_order_traversal, 5, 6, 47,
+ 62, 5, 197, boost::rational<long>(222, 47))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::post_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 4, 5, 35,
+ 46, 4, 130, boost::rational<long>(143, 35))
+ (boost::tree_node::pre_order_traversal, 5, 4, 24,
+ 31, 3, 76, boost::rational<long>(10, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::post_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 4, 3, 12,
+ 15, 2, 32, boost::rational<long>(8, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::post_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::post_order_traversal, 4, 3, 12,
+ 15, 2, 32, boost::rational<long>(8, 3))
+ (boost::tree_node::post_order_traversal, 5, 4, 24,
+ 31, 3, 76, boost::rational<long>(10, 3))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::post_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::post_order_traversal, 4, 5, 35,
+ 46, 4, 130, boost::rational<long>(143, 35))
+ (boost::tree_node::post_order_traversal, 5, 6, 47,
+ 62, 5, 197, boost::rational<long>(222, 47));
+#else // !defined BOOST_TREE_NODE_CAN_USE_FUSION
+ emplacer[bf_vals]
+ (5, 6, 47)(0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 2, 6)(4, 5, 35)(0, 0, 1)
+ (1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(5, 4, 24)(1, 0, 1)(2, 1, 3)
+ (3, 2, 6)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 2, 6)
+ (4, 3, 12)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)
+ (1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(2, 1, 3)
+ (3, 2, 6)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)
+ (0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1);
+ emplacer[pre_vals]
+ (5, 6, 47)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(3, 2, 6)
+ (0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(4, 5, 35)(5, 4, 24)
+ (0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(3, 2, 6)(0, 0, 1)
+ (1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(4, 3, 12)(0, 0, 1)(1, 0, 1)
+ (2, 1, 3)(0, 0, 1)(1, 0, 1)(3, 2, 6)(0, 0, 1)(1, 0, 1)(2, 1, 3)
+ (0, 0, 1)(1, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(3, 2, 6)
+ (0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1);
+ emplacer[post_vals]
+ (0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)
+ (0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 2, 6)(0, 0, 1)(1, 0, 1)(0, 0, 1)
+ (1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)
+ (3, 2, 6)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)
+ (1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 2, 6)(4, 3, 12)(5, 4, 24)
+ (1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(0, 0, 1)
+ (1, 0, 1)(2, 1, 3)(3, 2, 6)(4, 5, 35)(5, 6, 47);
+ emplacer[df_vals]
+ (boost::tree_node::pre_order_traversal, 5, 6, 47)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::post_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 4, 5, 35)
+ (boost::tree_node::pre_order_traversal, 5, 4, 24)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::post_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 4, 3, 12)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::post_order_traversal, 3, 2, 6)
+ (boost::tree_node::post_order_traversal, 4, 3, 12)
+ (boost::tree_node::post_order_traversal, 5, 4, 24)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::post_order_traversal, 3, 2, 6)
+ (boost::tree_node::post_order_traversal, 4, 5, 35)
+ (boost::tree_node::post_order_traversal, 5, 6, 47);
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+ test_node<a_node_case>(a_root, bf_vals, pre_vals, post_vals, df_vals);
+
+ a_child_itr = (*a_child_itr).begin();
+ std::advance(a_child_itr, 2);
+
+ typename ANode::iterator a_desc_itr = a_child_itr;
+ typename ANode::iterator a_src_itr = (*(++a_desc_itr)).begin();
+ typename ANode::iterator a_end_itr = (*a_desc_itr).end();
+
+ (*a_child_itr).splice(
+ ++(*a_child_itr).begin()
+ , *a_desc_itr
+ , ++a_src_itr
+ , a_end_itr
+ );
+ bf_vals.clear();
+ pre_vals.clear();
+ post_vals.clear();
+ df_vals.clear();
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ emplacer[bf_vals]
+ (5, 6, 47, 62, 5, 197, boost::rational<long>(222, 47))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (4, 5, 35, 46, 4, 130, boost::rational<long>(143, 35))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (5, 4, 24, 31, 3, 76, boost::rational<long>(10, 3))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 2, 7, 7, 1, 15, boost::rational<long>(13, 7))
+ (3, 1, 2, 3, 0, 3, boost::rational<long>(3, 2))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1));
+ emplacer[pre_vals]
+ (5, 6, 47, 62, 5, 197, boost::rational<long>(222, 47))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (4, 5, 35, 46, 4, 130, boost::rational<long>(143, 35))
+ (5, 4, 24, 31, 3, 76, boost::rational<long>(10, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 2, 7, 7, 1, 15, boost::rational<long>(13, 7))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 1, 2, 3, 0, 3, boost::rational<long>(3, 2))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1));
+ emplacer[post_vals]
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 2, 7, 7, 1, 15, boost::rational<long>(13, 7))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (3, 1, 2, 3, 0, 3, boost::rational<long>(3, 2))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (5, 4, 24, 31, 3, 76, boost::rational<long>(10, 3))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (4, 5, 35, 46, 4, 130, boost::rational<long>(143, 35))
+ (5, 6, 47, 62, 5, 197, boost::rational<long>(222, 47));
+ emplacer[df_vals]
+ (boost::tree_node::pre_order_traversal, 5, 6, 47,
+ 62, 5, 197, boost::rational<long>(222, 47))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::post_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 4, 5, 35,
+ 46, 4, 130, boost::rational<long>(143, 35))
+ (boost::tree_node::pre_order_traversal, 5, 4, 24,
+ 31, 3, 76, boost::rational<long>(10, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 2, 7,
+ 7, 1, 15, boost::rational<long>(13, 7))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 2, 7,
+ 7, 1, 15, boost::rational<long>(13, 7))
+ (boost::tree_node::pre_order_traversal, 3, 1, 2,
+ 3, 0, 3, boost::rational<long>(3, 2))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 3, 1, 2,
+ 3, 0, 3, boost::rational<long>(3, 2))
+ (boost::tree_node::pre_order_traversal, 4, 3, 12,
+ 15, 2, 32, boost::rational<long>(8, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::post_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::post_order_traversal, 4, 3, 12,
+ 15, 2, 32, boost::rational<long>(8, 3))
+ (boost::tree_node::post_order_traversal, 5, 4, 24,
+ 31, 3, 76, boost::rational<long>(10, 3))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::post_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::post_order_traversal, 4, 5, 35,
+ 46, 4, 130, boost::rational<long>(143, 35))
+ (boost::tree_node::post_order_traversal, 5, 6, 47,
+ 62, 5, 197, boost::rational<long>(222, 47));
+#else // !defined BOOST_TREE_NODE_CAN_USE_FUSION
+ emplacer[bf_vals]
+ (5, 6, 47)(0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 2, 6)(4, 5, 35)(0, 0, 1)
+ (1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(5, 4, 24)(1, 0, 1)(2, 1, 3)
+ (3, 2, 6)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 2, 7)(3, 1, 2)
+ (4, 3, 12)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)
+ (1, 0, 1)(2, 1, 3)(1, 0, 1)(0, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)
+ (3, 2, 6)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)
+ (0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1);
+ emplacer[pre_vals]
+ (5, 6, 47)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(3, 2, 6)
+ (0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(4, 5, 35)(5, 4, 24)
+ (0, 0, 1)(1, 0, 1)(2, 2, 7)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)
+ (1, 0, 1)(1, 0, 1)(3, 1, 2)(0, 0, 1)(4, 3, 12)(0, 0, 1)(1, 0, 1)
+ (2, 1, 3)(0, 0, 1)(1, 0, 1)(3, 2, 6)(0, 0, 1)(1, 0, 1)(2, 1, 3)
+ (0, 0, 1)(1, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(3, 2, 6)
+ (0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1);
+ emplacer[post_vals]
+ (0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)
+ (0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 2, 6)(0, 0, 1)(1, 0, 1)(0, 0, 1)
+ (1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(1, 0, 1)(2, 2, 7)(0, 0, 1)
+ (3, 1, 2)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)
+ (1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 2, 6)(4, 3, 12)(5, 4, 24)
+ (1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(0, 0, 1)
+ (1, 0, 1)(2, 1, 3)(3, 2, 6)(4, 5, 35)(5, 6, 47);
+ emplacer[df_vals]
+ (boost::tree_node::pre_order_traversal, 5, 6, 47)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::post_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 4, 5, 35)
+ (boost::tree_node::pre_order_traversal, 5, 4, 24)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 2, 7)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 2, 7)
+ (boost::tree_node::pre_order_traversal, 3, 1, 2)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 3, 1, 2)
+ (boost::tree_node::pre_order_traversal, 4, 3, 12)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::post_order_traversal, 3, 2, 6)
+ (boost::tree_node::post_order_traversal, 4, 3, 12)
+ (boost::tree_node::post_order_traversal, 5, 4, 24)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::post_order_traversal, 3, 2, 6)
+ (boost::tree_node::post_order_traversal, 4, 5, 35)
+ (boost::tree_node::post_order_traversal, 5, 6, 47);
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+ test_node<a_node_case>(a_root, bf_vals, pre_vals, post_vals, df_vals);
+ }
+
+ {
+ typename ANode::iterator a_child_itr(a_root.begin());
+
+ std::advance(a_child_itr, 3);
+ (*a_child_itr).clear();
+
+ Values bf_vals, pre_vals, post_vals;
+ DFValues df_vals;
+ Emplacer emplacer;
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ emplacer[bf_vals]
+ (5, 6, 42, 58, 5, 180, boost::rational<long>(209, 42))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 0, 1, 3, 0, 1, boost::rational<long>(3, 1))
+ (4, 5, 35, 46, 4, 130, boost::rational<long>(143, 35))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (5, 4, 24, 31, 3, 76, boost::rational<long>(10, 3))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 2, 7, 7, 1, 15, boost::rational<long>(13, 7))
+ (3, 1, 2, 3, 0, 3, boost::rational<long>(3, 2))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1));
+ emplacer[pre_vals]
+ (5, 6, 42, 58, 5, 180, boost::rational<long>(209, 42))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 0, 1, 3, 0, 1, boost::rational<long>(3, 1))
+ (4, 5, 35, 46, 4, 130, boost::rational<long>(143, 35))
+ (5, 4, 24, 31, 3, 76, boost::rational<long>(10, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 2, 7, 7, 1, 15, boost::rational<long>(13, 7))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 1, 2, 3, 0, 3, boost::rational<long>(3, 2))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1));
+ emplacer[post_vals]
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 0, 1, 3, 0, 1, boost::rational<long>(3, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 2, 7, 7, 1, 15, boost::rational<long>(13, 7))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (3, 1, 2, 3, 0, 3, boost::rational<long>(3, 2))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (4, 3, 12, 15, 2, 32, boost::rational<long>(8, 3))
+ (5, 4, 24, 31, 3, 76, boost::rational<long>(10, 3))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (0, 0, 1, 0, 0, 1, boost::rational<long>(0, 1))
+ (1, 0, 1, 1, 0, 1, boost::rational<long>(1, 1))
+ (2, 1, 3, 3, 0, 5, boost::rational<long>(4, 3))
+ (3, 2, 6, 7, 1, 13, boost::rational<long>(2, 1))
+ (4, 5, 35, 46, 4, 130, boost::rational<long>(143, 35))
+ (5, 6, 42, 58, 5, 180, boost::rational<long>(209, 42));
+ emplacer[df_vals]
+ (boost::tree_node::pre_order_traversal, 5, 6, 42,
+ 58, 5, 180, boost::rational<long>(209, 42))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 3, 0, 1,
+ 3, 0, 1, boost::rational<long>(3, 1))
+ (boost::tree_node::post_order_traversal, 3, 0, 1,
+ 3, 0, 1, boost::rational<long>(3, 1))
+ (boost::tree_node::pre_order_traversal, 4, 5, 35,
+ 46, 4, 130, boost::rational<long>(143, 35))
+ (boost::tree_node::pre_order_traversal, 5, 4, 24,
+ 31, 3, 76, boost::rational<long>(10, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 2, 7,
+ 7, 1, 15, boost::rational<long>(13, 7))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 2, 7,
+ 7, 1, 15, boost::rational<long>(13, 7))
+ (boost::tree_node::pre_order_traversal, 3, 1, 2,
+ 3, 0, 3, boost::rational<long>(3, 2))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 3, 1, 2,
+ 3, 0, 3, boost::rational<long>(3, 2))
+ (boost::tree_node::pre_order_traversal, 4, 3, 12,
+ 15, 2, 32, boost::rational<long>(8, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::post_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::post_order_traversal, 4, 3, 12,
+ 15, 2, 32, boost::rational<long>(8, 3))
+ (boost::tree_node::post_order_traversal, 5, 4, 24,
+ 31, 3, 76, boost::rational<long>(10, 3))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::pre_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::pre_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::post_order_traversal, 0, 0, 1,
+ 0, 0, 1, boost::rational<long>(0, 1))
+ (boost::tree_node::pre_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 1, 0, 1,
+ 1, 0, 1, boost::rational<long>(1, 1))
+ (boost::tree_node::post_order_traversal, 2, 1, 3,
+ 3, 0, 5, boost::rational<long>(4, 3))
+ (boost::tree_node::post_order_traversal, 3, 2, 6,
+ 7, 1, 13, boost::rational<long>(2, 1))
+ (boost::tree_node::post_order_traversal, 4, 5, 35,
+ 46, 4, 130, boost::rational<long>(143, 35))
+ (boost::tree_node::post_order_traversal, 5, 6, 42,
+ 58, 5, 180, boost::rational<long>(209, 42));
+#else // !defined BOOST_TREE_NODE_CAN_USE_FUSION
+ emplacer[bf_vals]
+ (5, 6, 42)(0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 0, 1)(4, 5, 35)(0, 0, 1)
+ (1, 0, 1)(5, 4, 24)(1, 0, 1)(2, 1, 3)(3, 2, 6)(0, 0, 1)(1, 0, 1)
+ (2, 2, 7)(3, 1, 2)(4, 3, 12)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)
+ (2, 1, 3)(0, 0, 1)(1, 0, 1)(2, 1, 3)(1, 0, 1)(0, 0, 1)(0, 0, 1)
+ (1, 0, 1)(2, 1, 3)(3, 2, 6)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)
+ (0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1);
+ emplacer[pre_vals]
+ (5, 6, 42)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(3, 0, 1)
+ (4, 5, 35)(5, 4, 24)(0, 0, 1)(1, 0, 1)(2, 2, 7)(0, 0, 1)(1, 0, 1)
+ (2, 1, 3)(0, 0, 1)(1, 0, 1)(1, 0, 1)(3, 1, 2)(0, 0, 1)(4, 3, 12)
+ (0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(3, 2, 6)(0, 0, 1)
+ (1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)
+ (1, 0, 1)(3, 2, 6)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)(1, 0, 1);
+ emplacer[post_vals]
+ (0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 0, 1)(0, 0, 1)
+ (1, 0, 1)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(1, 0, 1)
+ (2, 2, 7)(0, 0, 1)(3, 1, 2)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)
+ (2, 1, 3)(0, 0, 1)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 2, 6)
+ (4, 3, 12)(5, 4, 24)(1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(0, 0, 1)
+ (1, 0, 1)(0, 0, 1)(1, 0, 1)(2, 1, 3)(3, 2, 6)(4, 5, 35)(5, 6, 42);
+ emplacer[df_vals]
+ (boost::tree_node::pre_order_traversal, 5, 6, 42)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 3, 0, 1)
+ (boost::tree_node::post_order_traversal, 3, 0, 1)
+ (boost::tree_node::pre_order_traversal, 4, 5, 35)
+ (boost::tree_node::pre_order_traversal, 5, 4, 24)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 2, 7)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 2, 7)
+ (boost::tree_node::pre_order_traversal, 3, 1, 2)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 3, 1, 2)
+ (boost::tree_node::pre_order_traversal, 4, 3, 12)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::post_order_traversal, 3, 2, 6)
+ (boost::tree_node::post_order_traversal, 4, 3, 12)
+ (boost::tree_node::post_order_traversal, 5, 4, 24)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 3, 2, 6)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::pre_order_traversal, 2, 1, 3)
+ (boost::tree_node::pre_order_traversal, 0, 0, 1)
+ (boost::tree_node::post_order_traversal, 0, 0, 1)
+ (boost::tree_node::pre_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 1, 0, 1)
+ (boost::tree_node::post_order_traversal, 2, 1, 3)
+ (boost::tree_node::post_order_traversal, 3, 2, 6)
+ (boost::tree_node::post_order_traversal, 4, 5, 35)
+ (boost::tree_node::post_order_traversal, 5, 6, 42);
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+ test_node<a_node_case>(a_root, bf_vals, pre_vals, post_vals, df_vals);
+ }
+
+#if defined BOOST_TREE_NODE_CAN_USE_FUSION
+ typedef boost::tree_node::with_accumulation<
+ boost::tree_node::nary_node_base_gen<Selector>
+ , DataMap
+ , void
+ , AccuYourUintKey
+ >
+ FNode;
+ typedef typename boost::container_gen<
+ boost::dequeS
+ , boost::tuples::tuple<
+ typename boost::tree_node::result_of::value_at_key<
+ FNode const
+ , example_keys::your_uint
+ >::type
+ , typename boost::tree_node::result_of::value_at_key<
+ FNode const
+ , example_keys::your_char
+ >::type
+ , typename boost::tree_node::result_of::value_at_key<
+ FNode const
+ , AccuYourUintKey
+ >::type
+ >
+ >::type
+ MoreValues;
+ typedef typename boost::container_gen<
+ boost::dequeS
+ , boost::tuples::tuple<
+ boost::tree_node::traversal_state
+ , typename boost::tree_node::result_of::value_at_key<
+ FNode const
+ , example_keys::your_uint
+ >::type
+ , typename boost::tree_node::result_of::value_at_key<
+ FNode const
+ , example_keys::your_char
+ >::type
+ , typename boost::tree_node::result_of::value_at_key<
+ FNode const
+ , AccuYourUintKey
+ >::type
+ >
+ >::type
+ DFMoreValues;
+
+ FNode f_root(
+ boost::fusion::make_pair<example_keys::your_uint>(5)
+ , boost::fusion::make_pair<example_keys::your_char>('5')
+ );
+
+ for (
+ boost::tree_node::breadth_first_iterator<FNode> itr(f_root);
+ itr;
+ ++itr
+ )
+ {
+ typename boost::tree_node::result_of::value_at_key<
+ FNode const
+ , example_keys::your_uint
+ >::type data = boost::tree_node::get<example_keys::your_uint>(*itr);
+
+ if (1 < data)
+ {
+ for (unsigned int i = 0; i < data; ++i)
+ {
+ if (std::tr1::is_same<Selector,boost::slistS>::value)
+ {
+ (*itr).emplace(
+ boost::fusion::make_pair<example_keys::your_uint>(
+ data - 1 - i
+ )
+ , boost::fusion::make_pair<example_keys::your_char>(
+ '0' + data - 1 - i
+ )
+ );
+ }
+ else
+ {
+ (*itr).emplace(
+ boost::fusion::make_pair<example_keys::your_uint>(i)
+ , boost::fusion::make_pair<example_keys::your_char>(
+ '0' + i
+ )
+ );
+ }
+ }
+
+ }
+ }
+
+ {
+ MoreValues bf_vals, pre_vals, post_vals;
+ DFMoreValues df_vals;
+ Emplacer emplacer;
+
+ emplacer[bf_vals]
+ (5, '5', 31)(0, '0', 0)(1, '1', 1)(2, '2', 3)(3, '3', 7)
+ (4, '4', 15)(0, '0', 0)(1, '1', 1)(0, '0', 0)(1, '1', 1)
+ (2, '2', 3)(0, '0', 0)(1, '1', 1)(2, '2', 3)(3, '3', 7)
+ (0, '0', 0)(1, '1', 1)(0, '0', 0)(1, '1', 1)(0, '0', 0)
+ (1, '1', 1)(2, '2', 3)(0, '0', 0)(1, '1', 1);
+ emplacer[pre_vals]
+ (5, '5', 31)(0, '0', 0)(1, '1', 1)(2, '2', 3)(0, '0', 0)
+ (1, '1', 1)(3, '3', 7)(0, '0', 0)(1, '1', 1)(2, '2', 3)
+ (0, '0', 0)(1, '1', 1)(4, '4', 15)(0, '0', 0)(1, '1', 1)
+ (2, '2', 3)(0, '0', 0)(1, '1', 1)(3, '3', 7)(0, '0', 0)
+ (1, '1', 1)(2, '2', 3)(0, '0', 0)(1, '1', 1);
+ emplacer[post_vals]
+ (0, '0', 0)(1, '1', 1)(0, '0', 0)(1, '1', 1)(2, '2', 3)
+ (0, '0', 0)(1, '1', 1)(0, '0', 0)(1, '1', 1)(2, '2', 3)
+ (3, '3', 7)(0, '0', 0)(1, '1', 1)(0, '0', 0)(1, '1', 1)
+ (2, '2', 3)(0, '0', 0)(1, '1', 1)(0, '0', 0)(1, '1', 1)
+ (2, '2', 3)(3, '3', 7)(4, '4', 15)(5, '5', 31);
+ emplacer[df_vals]
+ (boost::tree_node::pre_order_traversal, 5, '5', 31)
+ (boost::tree_node::pre_order_traversal, 0, '0', 0)
+ (boost::tree_node::post_order_traversal, 0, '0', 0)
+ (boost::tree_node::pre_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 1, '1', 1)
+ (boost::tree_node::pre_order_traversal, 2, '2', 3)
+ (boost::tree_node::pre_order_traversal, 0, '0', 0)
+ (boost::tree_node::post_order_traversal, 0, '0', 0)
+ (boost::tree_node::pre_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 2, '2', 3)
+ (boost::tree_node::pre_order_traversal, 3, '3', 7)
+ (boost::tree_node::pre_order_traversal, 0, '0', 0)
+ (boost::tree_node::post_order_traversal, 0, '0', 0)
+ (boost::tree_node::pre_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 1, '1', 1)
+ (boost::tree_node::pre_order_traversal, 2, '2', 3)
+ (boost::tree_node::pre_order_traversal, 0, '0', 0)
+ (boost::tree_node::post_order_traversal, 0, '0', 0)
+ (boost::tree_node::pre_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 2, '2', 3)
+ (boost::tree_node::post_order_traversal, 3, '3', 7)
+ (boost::tree_node::pre_order_traversal, 4, '4', 15)
+ (boost::tree_node::pre_order_traversal, 0, '0', 0)
+ (boost::tree_node::post_order_traversal, 0, '0', 0)
+ (boost::tree_node::pre_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 1, '1', 1)
+ (boost::tree_node::pre_order_traversal, 2, '2', 3)
+ (boost::tree_node::pre_order_traversal, 0, '0', 0)
+ (boost::tree_node::post_order_traversal, 0, '0', 0)
+ (boost::tree_node::pre_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 2, '2', 3)
+ (boost::tree_node::pre_order_traversal, 3, '3', 7)
+ (boost::tree_node::pre_order_traversal, 0, '0', 0)
+ (boost::tree_node::post_order_traversal, 0, '0', 0)
+ (boost::tree_node::pre_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 1, '1', 1)
+ (boost::tree_node::pre_order_traversal, 2, '2', 3)
+ (boost::tree_node::pre_order_traversal, 0, '0', 0)
+ (boost::tree_node::post_order_traversal, 0, '0', 0)
+ (boost::tree_node::pre_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 2, '2', 3)
+ (boost::tree_node::post_order_traversal, 3, '3', 7)
+ (boost::tree_node::post_order_traversal, 4, '4', 15)
+ (boost::tree_node::post_order_traversal, 5, '5', 31);
+ test_node<f_node_case>(f_root, bf_vals, pre_vals, post_vals, df_vals);
+
+ typename FNode::iterator f_child_itr(f_root.begin());
+
+ std::advance(f_child_itr, 3);
+ f_child_itr = (*f_child_itr).begin();
+ std::advance(f_child_itr, 2);
+ boost::tree_node::put(*f_child_itr, example_keys::your_uint(), 7);
+ bf_vals.clear();
+ pre_vals.clear();
+ post_vals.clear();
+ df_vals.clear();
+
+ emplacer[bf_vals]
+ (5, '5', 36)(0, '0', 0)(1, '1', 1)(2, '2', 3)(3, '3', 12)
+ (4, '4', 15)(0, '0', 0)(1, '1', 1)(0, '0', 0)(1, '1', 1)
+ (7, '2', 8)(0, '0', 0)(1, '1', 1)(2, '2', 3)(3, '3', 7)
+ (0, '0', 0)(1, '1', 1)(0, '0', 0)(1, '1', 1)(0, '0', 0)
+ (1, '1', 1)(2, '2', 3)(0, '0', 0)(1, '1', 1);
+ emplacer[pre_vals]
+ (5, '5', 36)(0, '0', 0)(1, '1', 1)(2, '2', 3)(0, '0', 0)
+ (1, '1', 1)(3, '3', 12)(0, '0', 0)(1, '1', 1)(7, '2', 8)
+ (0, '0', 0)(1, '1', 1)(4, '4', 15)(0, '0', 0)(1, '1', 1)
+ (2, '2', 3)(0, '0', 0)(1, '1', 1)(3, '3', 7)(0, '0', 0)
+ (1, '1', 1)(2, '2', 3)(0, '0', 0)(1, '1', 1);
+ emplacer[post_vals]
+ (0, '0', 0)(1, '1', 1)(0, '0', 0)(1, '1', 1)(2, '2', 3)
+ (0, '0', 0)(1, '1', 1)(0, '0', 0)(1, '1', 1)(7, '2', 8)
+ (3, '3', 12)(0, '0', 0)(1, '1', 1)(0, '0', 0)(1, '1', 1)
+ (2, '2', 3)(0, '0', 0)(1, '1', 1)(0, '0', 0)(1, '1', 1)
+ (2, '2', 3)(3, '3', 7)(4, '4', 15)(5, '5', 36);
+ emplacer[df_vals]
+ (boost::tree_node::pre_order_traversal, 5, '5', 36)
+ (boost::tree_node::pre_order_traversal, 0, '0', 0)
+ (boost::tree_node::post_order_traversal, 0, '0', 0)
+ (boost::tree_node::pre_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 1, '1', 1)
+ (boost::tree_node::pre_order_traversal, 2, '2', 3)
+ (boost::tree_node::pre_order_traversal, 0, '0', 0)
+ (boost::tree_node::post_order_traversal, 0, '0', 0)
+ (boost::tree_node::pre_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 2, '2', 3)
+ (boost::tree_node::pre_order_traversal, 3, '3', 12)
+ (boost::tree_node::pre_order_traversal, 0, '0', 0)
+ (boost::tree_node::post_order_traversal, 0, '0', 0)
+ (boost::tree_node::pre_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 1, '1', 1)
+ (boost::tree_node::pre_order_traversal, 7, '2', 8)
+ (boost::tree_node::pre_order_traversal, 0, '0', 0)
+ (boost::tree_node::post_order_traversal, 0, '0', 0)
+ (boost::tree_node::pre_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 7, '2', 8)
+ (boost::tree_node::post_order_traversal, 3, '3', 12)
+ (boost::tree_node::pre_order_traversal, 4, '4', 15)
+ (boost::tree_node::pre_order_traversal, 0, '0', 0)
+ (boost::tree_node::post_order_traversal, 0, '0', 0)
+ (boost::tree_node::pre_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 1, '1', 1)
+ (boost::tree_node::pre_order_traversal, 2, '2', 3)
+ (boost::tree_node::pre_order_traversal, 0, '0', 0)
+ (boost::tree_node::post_order_traversal, 0, '0', 0)
+ (boost::tree_node::pre_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 2, '2', 3)
+ (boost::tree_node::pre_order_traversal, 3, '3', 7)
+ (boost::tree_node::pre_order_traversal, 0, '0', 0)
+ (boost::tree_node::post_order_traversal, 0, '0', 0)
+ (boost::tree_node::pre_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 1, '1', 1)
+ (boost::tree_node::pre_order_traversal, 2, '2', 3)
+ (boost::tree_node::pre_order_traversal, 0, '0', 0)
+ (boost::tree_node::post_order_traversal, 0, '0', 0)
+ (boost::tree_node::pre_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 1, '1', 1)
+ (boost::tree_node::post_order_traversal, 2, '2', 3)
+ (boost::tree_node::post_order_traversal, 3, '3', 7)
+ (boost::tree_node::post_order_traversal, 4, '4', 15)
+ (boost::tree_node::post_order_traversal, 5, '5', 36);
+ test_node<f_node_case>(f_root, bf_vals, pre_vals, post_vals, df_vals);
+ }
+#endif // BOOST_TREE_NODE_CAN_USE_FUSION
+}
+
+#if defined BOOST_MSVC
+ #pragma warning (pop)
+#endif
+
+#if defined BOOST_TYPEOF_EMULATION
+#include <boost/typeof/boost/ptr_container/ptr_vector.hpp>
+#include <boost/typeof/boost/ptr_container/ptr_deque.hpp>
+#include <boost/typeof/boost/ptr_container/ptr_list.hpp>
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/typeof/boost/container/vector.hpp>
+#include <boost/typeof/boost/container/stable_vector.hpp>
+#include <boost/typeof/boost/container/deque.hpp>
+#include <boost/typeof/boost/container/list.hpp>
+#include <boost/typeof/boost/container/slist.hpp>
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#endif // BOOST_TYPEOF_EMULATION
+
+int test_main(int argc, char** argv)
+{
+ test<boost::ptr_vecS>();
+ test<boost::ptr_dequeS>();
+ test<boost::ptr_listS>();
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ test<boost::vector_selector<boost::mpl::true_> >();
+// test<boost::stable_vecS>();
+// test<boost::deque_selector<boost::mpl::true_> >();
+ test<boost::list_selector<boost::mpl::true_> >();
+ test<boost::slistS>();
+#endif
+
+ return 0;
+}
+


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk