diff --git a/include/boost/unordered/detail/allocator_helpers.hpp b/include/boost/unordered/detail/allocator_helpers.hpp index dbba5046..bdc8d8e6 100644 --- a/include/boost/unordered/detail/allocator_helpers.hpp +++ b/include/boost/unordered/detail/allocator_helpers.hpp @@ -27,7 +27,14 @@ #include #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 diff --git a/test/unordered/allocator_traits.cpp b/test/unordered/allocator_traits.cpp index ef7f61fe..777ac14e 100644 --- a/test/unordered/allocator_traits.cpp +++ b/test/unordered/allocator_traits.cpp @@ -132,7 +132,7 @@ void test_allocator1() BOOST_MPL_ASSERT((boost::is_same::type>)); #else - BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); #endif BOOST_MPL_ASSERT((boost::is_same)); BOOST_MPL_ASSERT((boost::is_same));