diff --git a/include/boost/unordered/detail/allocator_helpers.hpp b/include/boost/unordered/detail/allocator_helpers.hpp index c88c4021..dbba5046 100644 --- a/include/boost/unordered/detail/allocator_helpers.hpp +++ b/include/boost/unordered/detail/allocator_helpers.hpp @@ -202,7 +202,8 @@ namespace boost { namespace unordered { namespace detail { template struct rebind_wrap { - typedef typename std::allocator_traits::rebind_alloc type; + typedef typename std::allocator_traits:: + template rebind_alloc type; }; #else diff --git a/test/objects/minimal.hpp b/test/objects/minimal.hpp index 4c7118b6..f0b7bdcf 100644 --- a/test/objects/minimal.hpp +++ b/test/objects/minimal.hpp @@ -333,7 +333,7 @@ namespace minimal typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; typedef void_ptr void_pointer; - typedef void_const_ptr void_const_pointer; + typedef void_const_ptr const_void_pointer; typedef ptr pointer; typedef const_ptr const_pointer; typedef T& reference; diff --git a/test/unordered/allocator_traits.cpp b/test/unordered/allocator_traits.cpp index ba8ac0d8..777ac14e 100644 --- a/test/unordered/allocator_traits.cpp +++ b/test/unordered/allocator_traits.cpp @@ -90,7 +90,12 @@ void test_empty_allocator() { typedef empty_allocator allocator; typedef boost::unordered::detail::allocator_traits traits; +#if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS + BOOST_MPL_ASSERT((boost::is_same::type>)); +#else BOOST_MPL_ASSERT((boost::is_same)); +#endif BOOST_MPL_ASSERT((boost::is_same)); BOOST_MPL_ASSERT((boost::is_same)); BOOST_MPL_ASSERT((boost::is_same)); @@ -123,7 +128,12 @@ void test_allocator1() { typedef allocator1 allocator; typedef boost::unordered::detail::allocator_traits traits; - BOOST_MPL_ASSERT((boost::is_same)); +#if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS + BOOST_MPL_ASSERT((boost::is_same::type>)); +#else + BOOST_MPL_ASSERT((boost::is_same)); +#endif BOOST_MPL_ASSERT((boost::is_same)); BOOST_MPL_ASSERT((boost::is_same)); BOOST_MPL_ASSERT((boost::is_same)); @@ -186,6 +196,20 @@ struct ptr T& operator*() const { return *value_; } }; +template <> +struct ptr +{ + void* value_; + ptr(void* v) : value_(v) {} +}; + +template <> +struct ptr +{ + void const* value_; + ptr(void const* v) : value_(v) {} +}; + template struct allocator3 { diff --git a/test/unordered/minimal_allocator.cpp b/test/unordered/minimal_allocator.cpp index 7904ae9f..bce75751 100644 --- a/test/unordered/minimal_allocator.cpp +++ b/test/unordered/minimal_allocator.cpp @@ -51,7 +51,13 @@ void test_simple_allocator() //BOOST_MPL_ASSERT((boost::is_same)); BOOST_MPL_ASSERT((boost::is_same)); + +#if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS + BOOST_MPL_ASSERT((boost::is_same::type>)); +#else BOOST_MPL_ASSERT((boost::is_same)); +#endif BOOST_TEST(!traits::propagate_on_container_copy_assignment::value); BOOST_TEST(!traits::propagate_on_container_move_assignment::value);