From 03ffa0f35fcb303fe88d2d5a941ad9cf5c9aa61a Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 2 Apr 2013 00:13:51 +0000 Subject: [PATCH] rtree: added Allocators copy assignments for C++11, warning disabled. [SVN r83704] --- include/boost/geometry/index/detail/config_begin.hpp | 3 +++ .../index/detail/rtree/node/node_d_mem_dynamic.hpp | 12 +++++++++++- .../index/detail/rtree/node/node_d_mem_static.hpp | 12 +++++++++++- .../index/detail/rtree/node/node_s_mem_dynamic.hpp | 11 ++++++++++- .../index/detail/rtree/node/node_s_mem_static.hpp | 11 ++++++++++- include/boost/geometry/index/rtree.hpp | 3 ++- 6 files changed, 47 insertions(+), 5 deletions(-) diff --git a/include/boost/geometry/index/detail/config_begin.hpp b/include/boost/geometry/index/detail/config_begin.hpp index a5a488ff6..09d7748de 100644 --- a/include/boost/geometry/index/detail/config_begin.hpp +++ b/include/boost/geometry/index/detail/config_begin.hpp @@ -16,6 +16,9 @@ #pragma warning (disable : 4512) // assignment operator could not be generated #pragma warning (disable : 4127) // conditional expression is constant + // temporary? + #pragma warning (disable : 4180) // qualifier applied to function type has no meaning + #else //BOOST_MSVC #define BOOST_GEOMETRY_INDEX_DETAIL_USE_PARAM(A) diff --git a/include/boost/geometry/index/detail/rtree/node/node_d_mem_dynamic.hpp b/include/boost/geometry/index/detail/rtree/node/node_d_mem_dynamic.hpp index 60b08ff12..0e04c144f 100644 --- a/include/boost/geometry/index/detail/rtree/node/node_d_mem_dynamic.hpp +++ b/include/boost/geometry/index/detail/rtree/node/node_d_mem_dynamic.hpp @@ -188,7 +188,8 @@ public: , leaf_allocator_type() {} - inline explicit allocators(Allocator const& alloc) + template + inline explicit allocators(Alloc const& alloc) : internal_node_allocator_type(alloc) , leaf_allocator_type(alloc) {} @@ -205,6 +206,15 @@ public: return *this; } +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + inline allocators & operator=(allocators const& a) + { + internal_node_allocator() = a.internal_node_allocator(); + leaf_allocator() = a.leaf_allocator(); + return *this; + } +#endif + void swap(allocators & a) { boost::swap(internal_node_allocator(), a.internal_node_allocator()); diff --git a/include/boost/geometry/index/detail/rtree/node/node_d_mem_static.hpp b/include/boost/geometry/index/detail/rtree/node/node_d_mem_static.hpp index 9c23ba4ce..8212aa605 100644 --- a/include/boost/geometry/index/detail/rtree/node/node_d_mem_static.hpp +++ b/include/boost/geometry/index/detail/rtree/node/node_d_mem_static.hpp @@ -137,7 +137,8 @@ public: , leaf_allocator_type() {} - inline explicit allocators(Allocator const& alloc) + template + inline explicit allocators(Alloc const& alloc) : internal_node_allocator_type(alloc) , leaf_allocator_type(alloc) {} @@ -154,6 +155,15 @@ public: return *this; } +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + inline allocators & operator=(allocators const& a) + { + internal_node_allocator() = a.internal_node_allocator(); + leaf_allocator() = a.leaf_allocator(); + return *this; + } +#endif + void swap(allocators & a) { boost::swap(internal_node_allocator(), a.internal_node_allocator()); diff --git a/include/boost/geometry/index/detail/rtree/node/node_s_mem_dynamic.hpp b/include/boost/geometry/index/detail/rtree/node/node_s_mem_dynamic.hpp index 4c651a670..8405e1bc7 100644 --- a/include/boost/geometry/index/detail/rtree/node/node_s_mem_dynamic.hpp +++ b/include/boost/geometry/index/detail/rtree/node/node_s_mem_dynamic.hpp @@ -115,7 +115,8 @@ public: : node_allocator_type() {} - inline explicit allocators(Allocator const& alloc) + template + inline explicit allocators(Alloc const& alloc) : node_allocator_type(alloc) {} @@ -129,6 +130,14 @@ public: return *this; } +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + inline allocators & operator=(allocators const& a) + { + node_allocator() = a.node_allocator(); + return *this; + } +#endif + void swap(allocators & a) { boost::swap(node_allocator(), a.node_allocator()); diff --git a/include/boost/geometry/index/detail/rtree/node/node_s_mem_static.hpp b/include/boost/geometry/index/detail/rtree/node/node_s_mem_static.hpp index 8727a1002..c0c7dcb10 100644 --- a/include/boost/geometry/index/detail/rtree/node/node_s_mem_static.hpp +++ b/include/boost/geometry/index/detail/rtree/node/node_s_mem_static.hpp @@ -113,7 +113,8 @@ public: : node_allocator_type() {} - inline explicit allocators(Allocator const& alloc) + template + inline explicit allocators(Alloc const& alloc) : node_allocator_type(alloc) {} @@ -127,6 +128,14 @@ public: return *this; } +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + inline allocators & operator=(allocators const& a) + { + node_allocator() = a.node_allocator(); + return *this; + } +#endif + void swap(allocators & a) { boost::swap(node_allocator(), a.node_allocator()); diff --git a/include/boost/geometry/index/rtree.hpp b/include/boost/geometry/index/rtree.hpp index e3cc150ec..b44b61df5 100644 --- a/include/boost/geometry/index/rtree.hpp +++ b/include/boost/geometry/index/rtree.hpp @@ -349,7 +349,7 @@ public: : m_members(src.m_members.indexable_getter(), src.m_members.equal_to(), src.m_members.parameters(), - boost::move(allocator)) + allocator) { if ( src.m_members.allocators() == allocator ) { @@ -1142,6 +1142,7 @@ private: { private: members_holder(members_holder const&); + members_holder & operator=(members_holder const&); public: template