Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74235 - trunk/boost/unordered/detail
From: dnljms_at_[hidden]
Date: 2011-09-04 15:49:12


Author: danieljames
Date: 2011-09-04 15:49:11 EDT (Sun, 04 Sep 2011)
New Revision: 74235
URL: http://svn.boost.org/trac/boost/changeset/74235

Log:
Unordered: Use `destroy` workaround for `allocator_traits`.
Text files modified:
   trunk/boost/unordered/detail/allocator_helpers.hpp | 18 +++++++++++++++++-
   trunk/boost/unordered/detail/util.hpp | 16 ----------------
   2 files changed, 17 insertions(+), 17 deletions(-)

Modified: trunk/boost/unordered/detail/allocator_helpers.hpp
==============================================================================
--- trunk/boost/unordered/detail/allocator_helpers.hpp (original)
+++ trunk/boost/unordered/detail/allocator_helpers.hpp 2011-09-04 15:49:11 EDT (Sun, 04 Sep 2011)
@@ -56,6 +56,22 @@
 
 namespace boost { namespace unordered { namespace detail {
 
+ // Explicitly call a destructor
+
+#if defined(BOOST_MSVC)
+#pragma warning(push)
+#pragma warning(disable:4100) // unreferenced formal parameter
+#endif
+
+ template <class T>
+ inline void destroy(T* x) {
+ x->~T();
+ }
+
+#if defined(BOOST_MSVC)
+#pragma warning(pop)
+#endif
+
 #if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS
     template <typename Alloc>
     struct allocator_traits : std::allocator_traits<Alloc> {};
@@ -364,7 +380,7 @@
         static void destroy(Alloc&, T* p, typename
                 boost::disable_if<has_destroy<Alloc, T>, void*>::type = 0)
         {
- p->~T();
+ ::boost::unordered::detail::destroy(p);
         }
 
         static size_type max_size(const Alloc& a)

Modified: trunk/boost/unordered/detail/util.hpp
==============================================================================
--- trunk/boost/unordered/detail/util.hpp (original)
+++ trunk/boost/unordered/detail/util.hpp 2011-09-04 15:49:11 EDT (Sun, 04 Sep 2011)
@@ -117,22 +117,6 @@
     struct map_extractor;
     struct no_key;
 
- // Explicitly call a destructor
-
-#if defined(BOOST_MSVC)
-#pragma warning(push)
-#pragma warning(disable:4100) // unreferenced formal parameter
-#endif
-
- template <class T>
- inline void destroy(T* x) {
- x->~T();
- }
-
-#if defined(BOOST_MSVC)
-#pragma warning(pop)
-#endif
-
 #if !defined(BOOST_NO_RVALUE_REFERENCES)
 
 #define BOOST_UNORDERED_RV_REF(T) BOOST_RV_REF(T)


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