Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76970 - in trunk: boost/unordered/detail libs/unordered/test/unordered
From: dnljms_at_[hidden]
Date: 2012-02-11 07:33:26


Author: danieljames
Date: 2012-02-11 07:33:25 EST (Sat, 11 Feb 2012)
New Revision: 76970
URL: http://svn.boost.org/trac/boost/changeset/76970

Log:
Unordered: Use C++11 allocator_traits with gcc 4.7.
Text files modified:
   trunk/boost/unordered/detail/allocator_helpers.hpp | 9 ++++++++-
   trunk/libs/unordered/test/unordered/allocator_traits.cpp | 2 +-
   2 files changed, 9 insertions(+), 2 deletions(-)

Modified: trunk/boost/unordered/detail/allocator_helpers.hpp
==============================================================================
--- trunk/boost/unordered/detail/allocator_helpers.hpp (original)
+++ trunk/boost/unordered/detail/allocator_helpers.hpp 2012-02-11 07:33:25 EST (Sat, 11 Feb 2012)
@@ -27,7 +27,14 @@
 #include <boost/utility/addressof.hpp>
 
 #if !defined(BOOST_UNORDERED_USE_ALLOCATOR_TRAITS)
-#define BOOST_UNORDERED_USE_ALLOCATOR_TRAITS 0
+# if defined(__GXX_EXPERIMENTAL_CXX0X__) && \
+ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
+# define BOOST_UNORDERED_USE_ALLOCATOR_TRAITS 1
+# endif
+#endif
+
+#if !defined(BOOST_UNORDERED_USE_ALLOCATOR_TRAITS)
+# define BOOST_UNORDERED_USE_ALLOCATOR_TRAITS 0
 #endif
 
 #if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS

Modified: trunk/libs/unordered/test/unordered/allocator_traits.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/allocator_traits.cpp (original)
+++ trunk/libs/unordered/test/unordered/allocator_traits.cpp 2012-02-11 07:33:25 EST (Sat, 11 Feb 2012)
@@ -132,7 +132,7 @@
     BOOST_MPL_ASSERT((boost::is_same<typename traits::size_type,
         std::make_unsigned<std::ptrdiff_t>::type>));
 #else
- BOOST_MPL_ASSERT((boost::is_same<traits::size_type, std::size_t>));
+ BOOST_MPL_ASSERT((boost::is_same<typename traits::size_type, std::size_t>));
 #endif
     BOOST_MPL_ASSERT((boost::is_same<traits::difference_type, std::ptrdiff_t>));
     BOOST_MPL_ASSERT((boost::is_same<traits::pointer, int*>));


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