$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r82866 - in sandbox-branches/geometry/index: boost/geometry/index/detail boost/geometry/index/detail/rtree/node boost/geometry/index/detail/rtree/rstar boost/geometry/index/detail/rtree/visitors test/rtree
From: adam.wulkiewicz_at_[hidden]
Date: 2013-02-13 23:34:36
Author: awulkiew
Date: 2013-02-13 23:34:34 EST (Wed, 13 Feb 2013)
New Revision: 82866
URL: http://svn.boost.org/trac/boost/changeset/82866
Log:
rtree errors fixes related to non-std allocator pointers usage
Text files modified: 
   sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/node_d_mem_dynamic.hpp |    23 +++++---                                
   sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/node_d_mem_static.hpp  |     6 +                                       
   sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/node_s_mem_dynamic.hpp |    71 ++++++++------------------              
   sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/node_s_mem_static.hpp  |    20 +++++--                                 
   sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/rstar/insert.hpp            |    40 ++++++++++----                          
   sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/visitors/insert.hpp         |    11 ++-                                     
   sandbox-branches/geometry/index/boost/geometry/index/detail/varray.hpp                        |   104 ++++++++++++++++++++++++++------------- 
   sandbox-branches/geometry/index/test/rtree/rtree_interprocess.cpp                             |     4 +                                       
   sandbox-branches/geometry/index/test/rtree/test_rtree_exceptions.hpp                          |    10 ++-                                     
   9 files changed, 168 insertions(+), 121 deletions(-)
Modified: sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/node_d_mem_dynamic.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/node_d_mem_dynamic.hpp	(original)
+++ sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/node_d_mem_dynamic.hpp	2013-02-13 23:34:34 EST (Wed, 13 Feb 2013)
@@ -257,14 +257,13 @@
 
 // create_node_impl
 
-template <typename BaseNodePtr>
+template <typename BaseNodePtr, typename Node>
 struct create_dynamic_node
 {
     template <typename AllocNode, typename AllocElems>
     static inline BaseNodePtr apply(AllocNode & alloc_node, AllocElems & alloc_elems)
     {
         typedef typename AllocNode::pointer P;
-        typedef typename AllocNode::value_type V;
 
         P p = alloc_node.allocate(1);
 
@@ -275,7 +274,7 @@
         {
             // NOTE/TODO
             // Here the whole node may be copied
-            alloc_node.construct(p, V(alloc_elems));
+            alloc_node.construct(p, Node(alloc_elems));
         }
         catch(...)
         {
@@ -289,15 +288,15 @@
 
 // destroy_node_impl
 
+template <typename Node>
 struct destroy_dynamic_node
 {
     template <typename AllocNode, typename BaseNodePtr>
     static inline void apply(AllocNode & alloc_node, BaseNodePtr n)
     {
-        typedef typename AllocNode::value_type V;
         typedef typename AllocNode::pointer P;
 
-        P p(&static_cast<V&>(rtree::get<V>(*n)));
+        P p(&static_cast<Node&>(rtree::get<Node>(*n)));
         alloc_node.destroy(p);
         alloc_node.deallocate(p, 1);
     }
@@ -315,7 +314,8 @@
     apply(Allocators & allocators)
     {
         return create_dynamic_node<
-            typename Allocators::node_pointer
+            typename Allocators::node_pointer,
+            dynamic_internal_node<Value, Parameters, Box, Allocators, Tag>
         >::apply(allocators.internal_node_allocator, allocators.internal_node_elements_allocator);
     }
 };
@@ -330,7 +330,8 @@
     apply(Allocators & allocators)
     {
         return create_dynamic_node<
-            typename Allocators::node_pointer
+            typename Allocators::node_pointer,
+            dynamic_leaf<Value, Parameters, Box, Allocators, Tag>
         >::apply(allocators.leaf_allocator, allocators.leaf_elements_allocator);
     }
 };
@@ -345,7 +346,9 @@
 {
     static inline void apply(Allocators & allocators, typename Allocators::node_pointer n)
     {
-        destroy_dynamic_node::apply(allocators.internal_node_allocator, n);
+        destroy_dynamic_node<
+            dynamic_internal_node<Value, Parameters, Box, Allocators, Tag>
+        >::apply(allocators.internal_node_allocator, n);
     }
 };
 
@@ -357,7 +360,9 @@
 {
     static inline void apply(Allocators & allocators, typename Allocators::node_pointer n)
     {
-        destroy_dynamic_node::apply(allocators.leaf_allocator, n);
+        destroy_dynamic_node<
+            dynamic_leaf<Value, Parameters, Box, Allocators, Tag>
+        >::apply(allocators.leaf_allocator, n);
     }
 };
 
Modified: sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/node_d_mem_static.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/node_d_mem_static.hpp	(original)
+++ sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/node_d_mem_static.hpp	2013-02-13 23:34:34 EST (Wed, 13 Feb 2013)
@@ -176,7 +176,8 @@
     apply(Allocators & allocators)
     {
         return create_dynamic_node<
-            typename Allocators::node_pointer
+            typename Allocators::node_pointer,
+            dynamic_internal_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
         >::apply(allocators.internal_node_allocator, allocators.internal_node_allocator);
     }
 };
@@ -191,7 +192,8 @@
     apply(Allocators & allocators)
     {
         return create_dynamic_node<
-            typename Allocators::node_pointer
+            typename Allocators::node_pointer,
+            dynamic_leaf<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
         >::apply(allocators.leaf_allocator, allocators.leaf_allocator);
     }
 };
Modified: sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/node_s_mem_dynamic.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/node_s_mem_dynamic.hpp	(original)
+++ sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/node_s_mem_dynamic.hpp	2013-02-13 23:34:34 EST (Wed, 13 Feb 2013)
@@ -27,7 +27,7 @@
     typedef boost::container::vector<
         std::pair<
             Box,
-            typename node<Value, Parameters, Box, Allocators, Tag>::type *
+            typename Allocators::node_pointer
         >,
         typename Allocators::internal_node_elements_allocator_type
     > elements_type;
@@ -85,39 +85,6 @@
     typedef static_visitor<> type;
 };
 
-// element's indexable type
-
-template <typename Value, typename Parameters, typename Box, typename Allocators, typename Tag, typename Translator>
-struct element_indexable_type<
-    std::pair<
-        Box,
-        boost::variant<
-            static_leaf<Value, Parameters, Box, Allocators, Tag>,
-            static_internal_node<Value, Parameters, Box, Allocators, Tag>
-        > *
-    >,
-    Translator
->
-{
-    typedef Box type;
-};
-
-// element's indexable getter
-
-template <typename Value, typename Parameters, typename Box, typename Allocators, typename Tag, typename Translator>
-inline Box const&
-element_indexable(std::pair<
-                      Box,
-                      boost::variant<
-                          static_leaf<Value, Parameters, Box, Allocators, Tag>,
-                          static_internal_node<Value, Parameters, Box, Allocators, Tag>
-                      > *
-                  > const& el,
-                  Translator const&)
-{
-    return el.first;
-}
-
 // allocators
 
 template <typename Allocator, typename Value, typename Parameters, typename Box>
@@ -132,10 +99,18 @@
 
     typedef typename allocator_type::template rebind<
         typename node<Value, Parameters, Box, allocators, node_s_mem_dynamic_tag>::type
+    >::other::pointer node_pointer;
+
+    typedef typename allocator_type::template rebind<
+        typename internal_node<Value, Parameters, Box, allocators, node_s_mem_dynamic_tag>::type
+    >::other::pointer internal_node_pointer;
+
+    typedef typename allocator_type::template rebind<
+        typename node<Value, Parameters, Box, allocators, node_s_mem_dynamic_tag>::type
     >::other node_allocator_type;
 
     typedef typename allocator_type::template rebind<
-        std::pair<Box, typename node<Value, Parameters, Box, allocators, node_s_mem_dynamic_tag>::type *>
+        std::pair<Box, node_pointer>
     >::other internal_node_elements_allocator_type;
 
     typedef typename allocator_type::template rebind<
@@ -186,13 +161,13 @@
 
 // create_node_variant
 
-template <typename Variant, typename Node>
+template <typename VariantPtr, typename Node>
 struct create_static_node
 {
     template <typename AllocNode, typename AllocElems>
-    static inline Variant * apply(AllocNode & alloc_node, AllocElems & alloc_elems)
+    static inline VariantPtr apply(AllocNode & alloc_node, AllocElems & alloc_elems)
     {
-        Variant * p = alloc_node.allocate(1);
+        VariantPtr p = alloc_node.allocate(1);
 
         if ( 0 == p )
             throw std::bad_alloc();
@@ -218,8 +193,8 @@
 template <typename Node>
 struct destroy_static_node
 {
-    template <typename AllocNode, typename Variant>
-    static inline void apply(AllocNode & alloc_node, Variant * n)
+    template <typename AllocNode, typename VariantPtr>
+    static inline void apply(AllocNode & alloc_node, VariantPtr n)
     {
         alloc_node.destroy(n);
         alloc_node.deallocate(n, 1);
@@ -234,13 +209,13 @@
     static_internal_node<Value, Parameters, Box, Allocators, Tag>
 >
 {
-    static inline typename node<Value, Parameters, Box, Allocators, Tag>::type *
+    static inline typename Allocators::node_pointer
     apply(Allocators & allocators)
     {
         return create_static_node<
-            typename node<Value, Parameters, Box, Allocators, Tag>::type,
+            typename Allocators::node_pointer,
             static_internal_node<Value, Parameters, Box, Allocators, Tag>
-        >::template apply(allocators.node_allocator, allocators.internal_node_elements_allocator);
+        >::apply(allocators.node_allocator, allocators.internal_node_elements_allocator);
     }
 };
 
@@ -250,13 +225,13 @@
     static_leaf<Value, Parameters, Box, Allocators, Tag>
 >
 {
-    static inline typename node<Value, Parameters, Box, Allocators, Tag>::type *
+    static inline typename Allocators::node_pointer
     apply(Allocators & allocators)
     {
         return create_static_node<
-            typename node<Value, Parameters, Box, Allocators, Tag>::type,
+            typename Allocators::node_pointer,
             static_leaf<Value, Parameters, Box, Allocators, Tag>
-        >::template apply(allocators.node_allocator, allocators.leaf_elements_allocator);
+        >::apply(allocators.node_allocator, allocators.leaf_elements_allocator);
     }
 };
 
@@ -268,7 +243,7 @@
     static_internal_node<Value, Parameters, Box, Allocators, Tag>
 >
 {
-    static inline void apply(Allocators & allocators, typename node<Value, Parameters, Box, Allocators, Tag>::type * n)
+    static inline void apply(Allocators & allocators, typename Allocators::node_pointer n)
     {
         destroy_static_node<
             static_internal_node<Value, Parameters, Box, Allocators, Tag>
@@ -282,7 +257,7 @@
     static_leaf<Value, Parameters, Box, Allocators, Tag>
 >
 {
-    static inline void apply(Allocators & allocators, typename node<Value, Parameters, Box, Allocators, Tag>::type * n)
+    static inline void apply(Allocators & allocators, typename Allocators::node_pointer n)
     {
         destroy_static_node<
             static_leaf<Value, Parameters, Box, Allocators, Tag>
Modified: sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/node_s_mem_static.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/node_s_mem_static.hpp	(original)
+++ sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/node/node_s_mem_static.hpp	2013-02-13 23:34:34 EST (Wed, 13 Feb 2013)
@@ -27,7 +27,7 @@
     typedef detail::varray<
         std::pair<
             Box,
-            typename node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>::type *
+            typename Allocators::node_pointer
         >,
         Parameters::max_elements + 1,
         typename Allocators::internal_node_elements_allocator_type
@@ -99,10 +99,18 @@
 
     typedef typename allocator_type::template rebind<
         typename node<Value, Parameters, Box, allocators, node_s_mem_static_tag>::type
+    >::other::pointer node_pointer;
+
+    typedef typename allocator_type::template rebind<
+        typename internal_node<Value, Parameters, Box, allocators, node_s_mem_static_tag>::type
+    >::other::pointer internal_node_pointer;
+
+    typedef typename allocator_type::template rebind<
+        typename node<Value, Parameters, Box, allocators, node_s_mem_static_tag>::type
     >::other node_allocator_type;
 
     typedef typename allocator_type::template rebind<
-        std::pair<Box, typename node<Value, Parameters, Box, allocators, node_s_mem_static_tag>::type *>
+        std::pair<Box, node_pointer>
     >::other internal_node_elements_allocator_type;
 
     typedef typename allocator_type::template rebind<
@@ -147,11 +155,11 @@
     static_internal_node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
 >
 {
-    static inline typename node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>::type *
+    static inline typename Allocators::node_pointer
     apply(Allocators & allocators)
     {
         return create_static_node<
-            typename node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>::type,
+            typename Allocators::node_pointer,
             static_internal_node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
         >::template apply(allocators.node_allocator, allocators.node_allocator);
     }
@@ -163,11 +171,11 @@
     static_leaf<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
 >
 {
-    static inline typename node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>::type *
+    static inline typename Allocators::node_pointer
     apply(Allocators & allocators)
     {
         return create_static_node<
-            typename node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>::type,
+            typename Allocators::node_pointer,
             static_leaf<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
         >::template apply(allocators.node_allocator, allocators.node_allocator);
     }
Modified: sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/rstar/insert.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/rstar/insert.hpp	(original)
+++ sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/rstar/insert.hpp	2013-02-13 23:34:34 EST (Wed, 13 Feb 2013)
@@ -28,11 +28,12 @@
     typedef typename rtree::leaf<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag>::type leaf;
 
     typedef typename Options::parameters_type parameters_type;
+    typedef typename Allocators::internal_node_pointer internal_node_pointer;
 
-    template <typename Node>
-    static inline void apply(typename rtree::elements_type<Node>::type & result_elements,
+    template <typename ResultElements, typename Node>
+    static inline void apply(ResultElements & result_elements,
                              Node & n,
-                             internal_node *parent,
+                             internal_node_pointer parent,
                              size_t current_child_index,
                              parameters_type const& parameters,
                              Translator const& translator,
@@ -161,11 +162,18 @@
     typedef typename base::leaf leaf;
 
     typedef typename level_insert_elements_type<InsertIndex, Element, Value, Options, Box, Allocators>::type elements_type;
+    typedef typename index::detail::rtree::container_from_elements_type<
+        elements_type,
+        typename elements_type::value_type
+    >::type result_elements_type;
+
     typedef typename Options::parameters_type parameters_type;
 
-    inline level_insert_base(node* & root,
-                              size_t & leafs_level,
-                              Element const& element,
+    typedef typename Allocators::node_pointer node_pointer;
+
+    inline level_insert_base(node_pointer & root,
+                             size_t & leafs_level,
+                             Element const& element,
                              parameters_type const& parameters,
                              Translator const& translator,
                              Allocators & allocators,
@@ -225,7 +233,7 @@
     }
 
     size_t result_relative_level;
-    elements_type result_elements;
+    result_elements_type result_elements;
 };
 
 template <size_t InsertIndex, typename Element, typename Value, typename Options, typename Translator, typename Box, typename Allocators>
@@ -239,7 +247,9 @@
 
     typedef typename Options::parameters_type parameters_type;
 
-    inline level_insert(node* & root,
+    typedef typename Allocators::node_pointer node_pointer;
+
+    inline level_insert(node_pointer & root,
                         size_t & leafs_level,
                         Element const& element,
                         parameters_type const& parameters,
@@ -321,7 +331,9 @@
 
     typedef typename Options::parameters_type parameters_type;
 
-    inline level_insert(node* & root,
+    typedef typename Allocators::node_pointer node_pointer;
+
+    inline level_insert(node_pointer & root,
                         size_t & leafs_level,
                         Value const& v,
                         parameters_type const& parameters,
@@ -374,7 +386,9 @@
 
     typedef typename Options::parameters_type parameters_type;
 
-    inline level_insert(node* & root,
+    typedef typename Allocators::node_pointer node_pointer;
+
+    inline level_insert(node_pointer & root,
                         size_t & leafs_level,
                         Value const& v,
                         parameters_type const& parameters,
@@ -430,8 +444,10 @@
     typedef typename rtree::internal_node<Value, parameters_type, Box, Allocators, typename Options::node_tag>::type internal_node;
     typedef typename rtree::leaf<Value, parameters_type, Box, Allocators, typename Options::node_tag>::type leaf;
 
+    typedef typename Allocators::node_pointer node_pointer;
+
 public:
-    inline insert(node* & root,
+    inline insert(node_pointer & root,
                   size_t & leafs_level,
                   Element const& element,
                   parameters_type const& parameters,
@@ -506,7 +522,7 @@
         }
     }
 
-    node* & m_root;
+    node_pointer & m_root;
     size_t & m_leafs_level;
     Element const& m_element;
 
Modified: sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/visitors/insert.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/visitors/insert.hpp	(original)
+++ sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/visitors/insert.hpp	2013-02-13 23:34:34 EST (Wed, 13 Feb 2013)
@@ -180,7 +180,7 @@
 
 namespace visitors { namespace detail {
 
-template <typename InternalNode>
+template <typename InternalNode, typename InternalNodePtr>
 struct insert_traverse_data
 {
     typedef typename rtree::elements_type<InternalNode>::type elements_type;
@@ -190,7 +190,7 @@
         : parent(0), current_child_index(0), current_level(0)
     {}
 
-    void move_to_next_level(InternalNode * new_parent, size_t new_child_index)
+    void move_to_next_level(InternalNodePtr new_parent, size_t new_child_index)
     {
         parent = new_parent;
         current_child_index = new_child_index;
@@ -214,7 +214,7 @@
         return rtree::elements(*parent)[current_child_index];
     }
 
-    InternalNode * parent;
+    InternalNodePtr parent;
     size_t current_child_index;
     size_t current_level;
 };
@@ -234,6 +234,7 @@
 
     typedef rtree::node_auto_ptr<Value, Options, Translator, Box, Allocators> node_auto_ptr;
     typedef typename Allocators::node_pointer node_pointer;
+    typedef typename Allocators::internal_node_pointer internal_node_pointer;
 
     inline insert(node_pointer & root,
                   size_t & leafs_level,
@@ -296,7 +297,7 @@
     inline void traverse_apply_visitor(Visitor & visitor, internal_node &n, size_t choosen_node_index)
     {
         // save previous traverse inputs and set new ones
-        insert_traverse_data<internal_node> backup_traverse_data = m_traverse_data;
+        insert_traverse_data<internal_node, internal_node_pointer> backup_traverse_data = m_traverse_data;
 
         // calculate new traverse inputs
         m_traverse_data.move_to_next_level(&n, choosen_node_index);
@@ -381,7 +382,7 @@
     size_t & m_leafs_level;
 
     // traversing input parameters
-    insert_traverse_data<internal_node> m_traverse_data;
+    insert_traverse_data<internal_node, internal_node_pointer> m_traverse_data;
 
     Allocators & m_allocators;
 };
Modified: sandbox-branches/geometry/index/boost/geometry/index/detail/varray.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/index/detail/varray.hpp	(original)
+++ sandbox-branches/geometry/index/boost/geometry/index/detail/varray.hpp	2013-02-13 23:34:34 EST (Wed, 13 Feb 2013)
@@ -548,21 +548,25 @@
                 mpl::or_<
                     is_same<Iterator, value_type *>,
                     is_same<Iterator, const value_type *>
+                >,
+                mpl::or_<
+                    is_same<iterator, value_type *>,
+                    is_same<iterator, const value_type *>
                 >
             >::type
         use_memcpy;
         
-        this->copy_dispatch(&(*first), &(*last), &(*dst), use_memcpy());                        // may throw
+        this->copy_dispatch(first, last, dst, use_memcpy());                        // may throw
     }
 
     void copy_dispatch(const value_type * first, const value_type * last, value_type * dst,
                        boost::mpl::bool_<true> const& /*use_memcpy*/)
     {
-        ::memcpy(dst, first, sizeof(value_type) * std::distance(first, last));
+        ::memmove(dst, first, sizeof(value_type) * std::distance(first, last));
     }
 
     template <typename Iterator>
-    void copy_dispatch(Iterator first, Iterator last, value_type * dst,
+    void copy_dispatch(Iterator first, Iterator last, iterator dst,
                        boost::mpl::bool_<false> const& /*use_memcpy*/)
     {
         std::copy(first, last, dst);                                                // may throw
@@ -579,11 +583,15 @@
                 mpl::or_<
                     is_same<Iterator, value_type *>,
                     is_same<Iterator, const value_type *>
+                >,
+                mpl::or_<
+                    is_same<iterator, value_type *>,
+                    is_same<iterator, const value_type *>
                 >
             >::type
         use_memcpy;
 
-        this->uninitialized_copy_dispatch(&(*first), &(*last), &(*dst), use_memcpy());          // may throw
+        this->uninitialized_copy_dispatch(first, last, dst, use_memcpy());          // may throw
     }
 
     void uninitialized_copy_dispatch(const value_type * first, const value_type * last, value_type * dst,
@@ -593,7 +601,7 @@
     }
 
     template <typename Iterator>
-    void uninitialized_copy_dispatch(Iterator first, Iterator last, value_type * dst,
+    void uninitialized_copy_dispatch(Iterator first, Iterator last, iterator dst,
                                      boost::mpl::bool_<false> const& /*use_memcpy*/)
     {
         std::uninitialized_copy(first, last, dst);                                  // may throw
@@ -611,39 +619,55 @@
             >::type
         use_memcpy;
 
-        uninitialized_fill_dispatch(&(*dst), v, use_memcpy());                         // may throw
+        uninitialized_fill_dispatch(dst, v, use_memcpy());                         // may throw
     }
 
-    void uninitialized_fill_dispatch(value_type * ptr, value_type const& v,
+    void uninitialized_fill_dispatch(iterator ptr, value_type const& v,
                                      boost::mpl::bool_<true> const& /*use_memcpy*/)
     {
         // TODO - check if value_type has operator& defined and call this version only if it hasn't
         const value_type * vptr = &v;
-        ::memcpy(ptr, vptr, sizeof(value_type));
+        ::memcpy(&(*ptr), vptr, sizeof(value_type));
     }
 
     template <typename V>
-    void uninitialized_fill_dispatch(value_type * ptr, V const& v,
+    void uninitialized_fill_dispatch(iterator ptr, V const& v,
                                      boost::mpl::bool_<false> const& /*use_memcpy*/)
     {
-        new (ptr) value_type(v);                                                    // may throw
+        new (&(*ptr)) value_type(v);                                                    // may throw
     }
 
     // move
 
-    void move(iterator first, iterator last, iterator dst)
+    template <typename Iterator>
+    void move(Iterator first, Iterator last, iterator dst)
     {
-        this->move_dispatch(&(*first), &(*last), &(*dst), has_trivial_assign<value_type>());    // may throw
+        typedef typename
+            mpl::and_<
+                has_trivial_assign<value_type>,
+                mpl::or_<
+                    is_same<Iterator, value_type *>,
+                    is_same<Iterator, const value_type *>
+                >,
+                mpl::or_<
+                    is_same<iterator, value_type *>,
+                    is_same<iterator, const value_type *>
+                >
+            >::type
+        use_memcpy;
+
+        this->move_dispatch(first, last, dst, use_memcpy());    // may throw
     }
 
-    void move_dispatch(value_type * first, value_type * last, value_type * dst,
-        boost::true_type const& /*has_trivial_assign*/)
+    void move_dispatch(const value_type * first, const value_type * last, value_type * dst,
+                       boost::mpl::bool_<true> const& /*use_mem*/)
     {
         ::memmove(dst, first, sizeof(value_type) * std::distance(first, last));
     }
 
-    void move_dispatch(value_type * first, value_type * last, value_type * dst,
-        boost::false_type const& /*has_trivial_assign*/)
+    template <typename Iterator>
+    void move_dispatch(Iterator first, Iterator last, iterator dst,
+                       boost::mpl::bool_<false> const& /*use_mem*/)
     {
         std::copy(first, last, dst);                                                // may throw
     }
@@ -652,18 +676,28 @@
 
     void move_backward(iterator first, iterator last, iterator dst)
     {
-        this->move_backward_dispatch(&(*first), &(*last), &(*dst), has_trivial_assign<value_type>());    // may throw
+        typedef typename
+            mpl::and_<
+                has_trivial_assign<value_type>,
+                mpl::or_<
+                    is_same<iterator, value_type *>,
+                    is_same<iterator, const value_type *>
+                >
+            >::type
+        use_memcpy;
+
+        this->move_backward_dispatch(first, last, dst, use_memcpy());    // may throw
     }
 
     void move_backward_dispatch(value_type * first, value_type * last, value_type * dst,
-                                boost::true_type const& /*has_trivial_assign*/)
+                                boost::mpl::bool_<true> const& /*has_trivial_assign*/)
     {
         difference_type n = std::distance(first, last);
         ::memmove(dst - n, first, sizeof(value_type) * n);
     }
 
-    void move_backward_dispatch(value_type * first, value_type * last, value_type * dst,
-                                boost::false_type const& /*has_trivial_assign*/)
+    void move_backward_dispatch(iterator first, iterator last, iterator dst,
+                                boost::mpl::bool_<false> const& /*has_trivial_assign*/)
     {
         std::copy_backward(first, last, dst);                                                // may throw
     }
@@ -673,19 +707,19 @@
     template <typename V>
     void fill(iterator dst, V const& v)
     {
-        fill_dispatch(&(*dst), v, has_trivial_assign<value_type>());                            // may throw
+        fill_dispatch(dst, v, has_trivial_assign<value_type>());                            // may throw
     }
 
-    void fill_dispatch(value_type * ptr, value_type const& v,
+    void fill_dispatch(iterator ptr, value_type const& v,
                        boost::true_type const& /*has_trivial_assign*/)
     {
         // TODO - check if value_type has operator& defined and call this version only if it hasn't
         const value_type * vptr = &v;
-        ::memcpy(ptr, vptr, sizeof(value_type));
+        ::memcpy(&(*ptr), vptr, sizeof(value_type));
     }
 
     template <typename V>
-    void fill_dispatch(value_type * ptr, V const& v,
+    void fill_dispatch(iterator ptr, V const& v,
                        boost::false_type const& /*has_trivial_assign*/)
     {
         *ptr = v;                                                                           // may throw
@@ -695,14 +729,14 @@
 
     void destroy(iterator first, iterator last)
     {
-        this->destroy_dispatch(&(*first), &(*last), has_trivial_destructor<value_type>());
+        this->destroy_dispatch(first, last, has_trivial_destructor<value_type>());
     }
 
-    void destroy_dispatch(value_type * /*first*/, value_type * /*last*/,
+    void destroy_dispatch(iterator /*first*/, iterator /*last*/,
                           boost::true_type const& /*has_trivial_destructor*/)
     {}
 
-    void destroy_dispatch(value_type * first, value_type * last,
+    void destroy_dispatch(iterator first, iterator last,
                           boost::false_type const& /*has_trivial_destructor*/)
     {
         for ( ; first != last ; ++first )
@@ -713,14 +747,14 @@
 
     void destroy(iterator it)
     {
-        this->destroy_dispatch(&(*it), has_trivial_destructor<value_type>());
+        this->destroy_dispatch(it, has_trivial_destructor<value_type>());
     }
 
-    void destroy_dispatch(value_type * /*ptr*/,
+    void destroy_dispatch(iterator /*ptr*/,
                           boost::true_type const& /*has_trivial_destructor*/)
     {}
 
-    void destroy_dispatch(value_type * ptr,
+    void destroy_dispatch(iterator ptr,
                           boost::false_type const& /*has_trivial_destructor*/)
     {
         ptr->~value_type();
@@ -730,21 +764,21 @@
 
     void construct(iterator first, iterator last)
     {
-        this->construct_dispatch(&(*first), &(*last), has_trivial_constructor<value_type>());   // may throw
+        this->construct_dispatch(first, last, has_trivial_constructor<value_type>());   // may throw
     }
 
-    void construct_dispatch(value_type * /*first*/, value_type * /*last*/,
+    void construct_dispatch(iterator /*first*/, iterator /*last*/,
                             boost::true_type const& /*has_trivial_constructor*/)
     {}
 
-    void construct_dispatch(value_type * first, value_type * last,
+    void construct_dispatch(iterator first, iterator last,
                             boost::false_type const& /*has_trivial_constructor*/)
     {
-        value_type * it = first;
+        iterator it = first;
         try
         {
             for ( ; it != last ; ++it )
-                new (it) value_type();                                                  // may throw
+                new (&(*it)) value_type();                                                  // may throw
         }
         catch(...)
         {
Modified: sandbox-branches/geometry/index/test/rtree/rtree_interprocess.cpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/rtree_interprocess.cpp	(original)
+++ sandbox-branches/geometry/index/test/rtree/rtree_interprocess.cpp	2013-02-13 23:34:34 EST (Wed, 13 Feb 2013)
@@ -64,6 +64,10 @@
 
     test_rtree_interprocess<P2f>(bgi::linear<32, 8>());
     test_rtree_interprocess<P2f>(bgi::runtime::linear(32, 8));
+    test_rtree_interprocess<P2f>(bgi::quadratic<32, 8>());
+    test_rtree_interprocess<P2f>(bgi::runtime::quadratic(32, 8));
+    test_rtree_interprocess<P2f>(bgi::rstar<32, 8>());
+    test_rtree_interprocess<P2f>(bgi::runtime::rstar(32, 8));
     
     return 0;
 }
Modified: sandbox-branches/geometry/index/test/rtree/test_rtree_exceptions.hpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/test_rtree_exceptions.hpp	(original)
+++ sandbox-branches/geometry/index/test/rtree/test_rtree_exceptions.hpp	2013-02-13 23:34:34 EST (Wed, 13 Feb 2013)
@@ -241,8 +241,9 @@
         throwing_node_settings::throw_if_required();
 
         return create_dynamic_node<
-            typename Allocators::node_pointer
-        >::template apply(allocators.internal_node_allocator, allocators.internal_node_allocator);
+            typename Allocators::node_pointer,
+            dynamic_internal_node<Value, Parameters, Box, Allocators, node_throwing_d_mem_static_tag>
+        >::apply(allocators.internal_node_allocator, allocators.internal_node_allocator);
     }
 };
 
@@ -259,8 +260,9 @@
         throwing_node_settings::throw_if_required();
 
         return create_dynamic_node<
-            typename Allocators::node_pointer
-        >::template apply(allocators.leaf_allocator, allocators.leaf_allocator);
+            typename Allocators::node_pointer,
+            dynamic_leaf<Value, Parameters, Box, Allocators, node_throwing_d_mem_static_tag>
+        >::apply(allocators.leaf_allocator, allocators.leaf_allocator);
     }
 };