diff --git a/include/boost/core/allocator_access.hpp b/include/boost/core/allocator_access.hpp index 764c122..37c2b7a 100644 --- a/include/boost/core/allocator_access.hpp +++ b/include/boost/core/allocator_access.hpp @@ -43,24 +43,29 @@ struct allocator_pointer { typedef typename A::pointer type; }; #else +namespace detail { + template -struct allocator_pointer { +struct alloc_ptr { typedef typename A::value_type* type; }; -namespace detail { - template struct alloc_void { typedef void type; }; +template +struct alloc_ptr::type> { + typedef typename A::pointer type; +}; + } /* detail */ template -struct allocator_pointer::type> { - typedef typename A::pointer type; +struct allocator_pointer { + typedef typename detail::alloc_ptr::type type; }; #endif @@ -70,18 +75,27 @@ struct allocator_const_pointer { typedef typename A::const_pointer type; }; #else +namespace detail { + template -struct allocator_const_pointer { - typedef typename pointer_traits::type>::template +struct alloc_const_ptr { + typedef typename boost::pointer_traits::type>::template rebind_to::type type; }; template -struct allocator_const_pointer::type> { +struct alloc_const_ptr::type> { typedef typename A::const_pointer type; }; + +} /* detail */ + +template +struct allocator_const_pointer { + typedef typename detail::alloc_const_ptr::type type; +}; #endif #if defined(BOOST_NO_CXX11_ALLOCATOR) @@ -90,18 +104,27 @@ struct allocator_void_pointer { typedef typename A::template rebind::other::pointer type; }; #else +namespace detail { + template -struct allocator_void_pointer { - typedef typename pointer_traits::type>::template +struct alloc_void_ptr { + typedef typename boost::pointer_traits::type>::template rebind_to::type type; }; template -struct allocator_void_pointer::type> { +struct alloc_void_ptr::type> { typedef typename A::void_pointer type; }; + +} /* detail */ + +template +struct allocator_void_pointer { + typedef typename detail::alloc_void_ptr::type type; +}; #endif #if defined(BOOST_NO_CXX11_ALLOCATOR) @@ -110,18 +133,27 @@ struct allocator_const_void_pointer { typedef typename A::template rebind::other::const_pointer type; }; #else +namespace detail { + template -struct allocator_const_void_pointer { - typedef typename pointer_traits::type>::template +struct alloc_const_void_ptr { + typedef typename boost::pointer_traits::type>::template rebind_to::type type; }; template -struct allocator_const_void_pointer::type> { +struct alloc_const_void_ptr::type> { typedef typename A::const_void_pointer type; }; + +} /* detail */ + +template +struct allocator_const_void_pointer { + typedef typename detail::alloc_const_void_ptr::type type; +}; #endif #if defined(BOOST_NO_CXX11_ALLOCATOR) @@ -130,17 +162,26 @@ struct allocator_difference_type { typedef typename A::difference_type type; }; #else +namespace detail { + template -struct allocator_difference_type { - typedef typename pointer_traits::type>::difference_type type; +struct alloc_diff_type { + typedef typename boost::pointer_traits::type>::difference_type type; }; template -struct allocator_difference_type::type> { +struct alloc_diff_type::type> { typedef typename A::difference_type type; }; + +} /* detail */ + +template +struct allocator_difference_type { + typedef typename detail::alloc_diff_type::type type; +}; #endif #if defined(BOOST_NO_CXX11_ALLOCATOR) @@ -149,17 +190,26 @@ struct allocator_size_type { typedef typename A::size_type type; }; #else +namespace detail { + template -struct allocator_size_type { +struct alloc_size_type { typedef typename std::make_unsigned::type>::type type; + boost::allocator_difference_type::type>::type type; }; template -struct allocator_size_type::type> { +struct alloc_size_type::type> { typedef typename A::size_type type; }; + +} /* detail */ + +template +struct allocator_size_type { + typedef typename detail::alloc_size_type::type type; +}; #endif #if defined(BOOST_NO_CXX11_ALLOCATOR) @@ -176,17 +226,26 @@ struct allocator_propagate_on_container_copy_assignment { typedef detail::alloc_false type; }; #else +namespace detail { + template -struct allocator_propagate_on_container_copy_assignment { +struct alloc_pocca { typedef std::false_type type; }; template -struct allocator_propagate_on_container_copy_assignment::type> { typedef typename A::propagate_on_container_copy_assignment type; }; + +} /* detail */ + +template +struct allocator_propagate_on_container_copy_assignment { + typedef typename detail::alloc_pocca::type type; +}; #endif #if defined(BOOST_NO_CXX11_ALLOCATOR) @@ -195,17 +254,26 @@ struct allocator_propagate_on_container_move_assignment { typedef detail::alloc_false type; }; #else +namespace detail { + template -struct allocator_propagate_on_container_move_assignment { +struct alloc_pocma { typedef std::false_type type; }; template -struct allocator_propagate_on_container_move_assignment::type> { typedef typename A::propagate_on_container_move_assignment type; }; + +} /* detail */ + +template +struct allocator_propagate_on_container_move_assignment { + typedef typename detail::alloc_pocma::type type; +}; #endif #if defined(BOOST_NO_CXX11_ALLOCATOR) @@ -214,17 +282,25 @@ struct allocator_propagate_on_container_swap { typedef detail::alloc_false type; }; #else +namespace detail { + template -struct allocator_propagate_on_container_swap { +struct alloc_pocs { typedef std::false_type type; }; template -struct allocator_propagate_on_container_swap::type> { +struct alloc_pocs::type> { typedef typename A::propagate_on_container_swap type; }; + +} /* detail */ + +template +struct allocator_propagate_on_container_swap { + typedef typename detail::alloc_pocs::type type; +}; #endif #if defined(BOOST_NO_CXX11_ALLOCATOR) @@ -233,16 +309,25 @@ struct allocator_is_always_equal { typedef detail::alloc_false type; }; #else +namespace detail { + template -struct allocator_is_always_equal { +struct alloc_equal { typedef typename std::is_empty::type type; }; template -struct allocator_is_always_equal::type> { +struct alloc_equal::type> { typedef typename A::is_always_equal type; }; + +} /* detail */ + +template +struct allocator_is_always_equal { + typedef typename detail::alloc_equal::type type; +}; #endif #if defined(BOOST_NO_CXX11_ALLOCATOR) @@ -261,18 +346,23 @@ struct alloc_to, T> { typedef A type; }; -} /* detail */ - template -struct allocator_rebind { - typedef typename detail::alloc_to::type type; +struct alloc_rebind { + typedef typename alloc_to::type type; }; template -struct allocator_rebind::other>::type> { +struct alloc_rebind::other>::type> { typedef typename A::template rebind::other type; }; + +} /* detail */ + +template +struct allocator_rebind { + typedef typename detail::alloc_rebind::type type; +}; #endif template