diff --git a/include/boost/interprocess/detail/named_proxy.hpp b/include/boost/interprocess/detail/named_proxy.hpp index 3f0643e0..8d358b23 100644 --- a/include/boost/interprocess/detail/named_proxy.hpp +++ b/include/boost/interprocess/detail/named_proxy.hpp @@ -43,28 +43,18 @@ namespace interprocess { namespace ipcdetail { template -struct placement_destroy +inline void named_construct_placement_destroy(void *mem, std::size_t num) { - placement_destroy() - {} - - virtual void destroy_n(void *mem, std::size_t num) - { - T* memory = static_cast(mem); - for(std::size_t destroyed = 0; destroyed < num; ++destroyed) - (memory++)->~T(); - } - - private: - void destroy(void *mem) - { static_cast(mem)->~T(); } + T* memory = static_cast(mem); \ + for(std::size_t destroyed = 0; destroyed < num; ++destroyed) + (memory++)->~T(); }; #ifdef BOOST_INTERPROCESS_PERFECT_FORWARDING template -struct CtorArgN : public placement_destroy +struct CtorArgN { typedef T object_type; typedef bool_ IsIterator; @@ -94,7 +84,7 @@ struct CtorArgN : public placement_destroy } } BOOST_INTERPROCESS_CATCH(...) { - this->placement_destroy::destroy_n(mem, constructed); + named_construct_placement_destroy(mem, constructed); BOOST_INTERPROCESS_RETHROW } BOOST_INTERPROCESS_CATCH_END } @@ -165,7 +155,7 @@ class named_proxy #define BOOST_INTERPROCESS_NAMED_PROXY_CTORARGN(N)\ \ template \ -struct CtorArg##N : placement_destroy\ +struct CtorArg##N\ {\ typedef T object_type;\ typedef CtorArg##N self_t;\ @@ -183,7 +173,7 @@ struct CtorArg##N : placement_destroy\ }\ }\ BOOST_INTERPROCESS_CATCH(...) {\ - this->placement_destroy::destroy_n(mem, constructed);\ + named_construct_placement_destroy(mem, constructed);\ BOOST_INTERPROCESS_RETHROW\ } BOOST_INTERPROCESS_CATCH_END\ }\ @@ -198,7 +188,7 @@ BOOST_MOVE_ITERATE_0TO9(BOOST_INTERPROCESS_NAMED_PROXY_CTORARGN) #define BOOST_INTERPROCESS_NAMED_PROXY_CTORITN(N)\ \ template \ -struct CtorIt##N : public placement_destroy\ +struct CtorIt##N\ {\ typedef T object_type;\ typedef CtorIt##N self_t;\ @@ -222,7 +212,7 @@ struct CtorIt##N : public placement_destroy\ }\ }\ BOOST_INTERPROCESS_CATCH(...) {\ - this->placement_destroy::destroy_n(mem, constructed);\ + named_construct_placement_destroy(mem, constructed);\ BOOST_INTERPROCESS_RETHROW\ } BOOST_INTERPROCESS_CATCH_END\ }\