Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75316 - sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors
From: adam.wulkiewicz_at_[hidden]
Date: 2011-11-04 10:57:12


Author: awulkiew
Date: 2011-11-04 10:57:11 EDT (Fri, 04 Nov 2011)
New Revision: 75316
URL: http://svn.boost.org/trac/boost/changeset/75316

Log:
split result OutIter replaced by reference to the container.
Text files modified:
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/insert.hpp | 20 ++++++++++----------
   1 files changed, 10 insertions(+), 10 deletions(-)

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/insert.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/insert.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/insert.hpp 2011-11-04 10:57:11 EDT (Fri, 04 Nov 2011)
@@ -113,12 +113,14 @@
     typedef typename Options::parameters_type parameters_type;
 
 public:
- template <typename Node, typename OutIter>
- static inline void apply(Node & n,
+ typedef index::pushable_array<std::pair<Box, node*>, 1> nodes_container_type;
+
+ template <typename Node>
+ static inline void apply(nodes_container_type & additional_nodes,
+ Node & n,
                              Box & n_box,
                              Translator const& tr,
- Allocators & allocators,
- OutIter out_it)
+ Allocators & allocators)
     {
         // create additional node
         node * second_node = rtree::create_node<Allocators, Node>::apply(allocators);
@@ -137,7 +139,7 @@
             rtree::elements(n2).size() <= parameters_type::max_elements,
             "unexpected number of elements");
 
- *out_it++ = std::make_pair(box2, second_node);
+ additional_nodes.push_back(std::make_pair(box2, second_node));
     }
 };
 
@@ -237,14 +239,12 @@
     template <typename Node>
     inline void split(Node & n) const
     {
- index::pushable_array<
- std::pair<Box, node*>, 1
- > additional_nodes;
+ typedef detail::split<Value, Options, Translator, Box, Allocators, typename Options::split_tag> split_algo;
 
+ typename split_algo::nodes_container_type additional_nodes;
         Box n_box;
 
- detail::split<Value, Options, Translator, Box, Allocators, typename Options::split_tag>
- ::apply(n, n_box, m_tr, m_allocators, std::back_inserter(additional_nodes));
+ split_algo::apply(additional_nodes, n, n_box, m_tr, m_allocators);
 
         BOOST_GEOMETRY_INDEX_ASSERT(additional_nodes.size() == 1, "unexpected number of additional nodes");
 


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