From 188bcafdece6a3764b019111e8f8eaa099b55bb9 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Thu, 26 Mar 2009 07:00:46 +0000 Subject: [PATCH] Try to destruct values in a way that all compilers might like. [SVN r51983] --- include/boost/unordered/detail/hash_table.hpp | 5 ----- include/boost/unordered/detail/hash_table_impl.hpp | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/include/boost/unordered/detail/hash_table.hpp b/include/boost/unordered/detail/hash_table.hpp index 4b145196..9d5e78e6 100644 --- a/include/boost/unordered/detail/hash_table.hpp +++ b/include/boost/unordered/detail/hash_table.hpp @@ -223,11 +223,6 @@ namespace boost { functions func2_; functions_ptr func_; // The currently active functions. }; - - template - void destroy(T* x) { - x->~T(); - } } } diff --git a/include/boost/unordered/detail/hash_table_impl.hpp b/include/boost/unordered/detail/hash_table_impl.hpp index 8d589cdb..145ef965 100644 --- a/include/boost/unordered/detail/hash_table_impl.hpp +++ b/include/boost/unordered/detail/hash_table_impl.hpp @@ -130,7 +130,7 @@ namespace boost { void destroy(link_ptr ptr) { node* raw_ptr = static_cast(&*ptr); - boost::unordered_detail::destroy(&raw_ptr->value()); + (&raw_ptr->value())->~value_type(); node_ptr n(node_alloc_.address(*raw_ptr)); node_alloc_.destroy(n); node_alloc_.deallocate(n, 1); @@ -172,7 +172,7 @@ namespace boost { { if (node_) { if (value_constructed_) { - boost::unordered_detail::destroy(&node_->value()); + (&node_->value())->~value_type(); } if (node_constructed_)