diff --git a/include/boost/smart_ptr/allocation_ptr.hpp b/include/boost/smart_ptr/allocation_ptr.hpp index 6cf5d51..f6a1683 100644 --- a/include/boost/smart_ptr/allocation_ptr.hpp +++ b/include/boost/smart_ptr/allocation_ptr.hpp @@ -10,6 +10,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include #include #if !defined(BOOST_NO_CXX11_ALLOCATOR) #include @@ -18,15 +19,19 @@ Distributed under the Boost Software License, Version 1.0. namespace boost { namespace detail { +#if !defined(BOOST_NO_CXX11_ALLOCATOR) template struct sp_allocation_ptr { -#if !defined(BOOST_NO_CXX11_ALLOCATOR) typedef typename std::allocator_traits::template - rebind_traits::pointer type; -#else - typedef typename A::template rebind::other::pointer type; -#endif + rebind_traits::type>::pointer type; }; +#else +template +struct sp_allocation_ptr { + typedef typename A::template + rebind::type>::other::pointer type; +}; +#endif } /* detail */ diff --git a/test/allocation_ptr_test.cpp b/test/allocation_ptr_test.cpp index 5218484..cf21d7c 100644 --- a/test/allocation_ptr_test.cpp +++ b/test/allocation_ptr_test.cpp @@ -17,18 +17,36 @@ void test_pointer(scalar) { BOOST_TEST_TRAIT_SAME(boost::allocation_ptr >::pointer, int*); + BOOST_TEST_TRAIT_SAME(boost::allocation_ptr >::pointer, int*); + BOOST_TEST_TRAIT_SAME(boost::allocation_ptr >::pointer, int*); + BOOST_TEST_TRAIT_SAME(boost::allocation_ptr >::pointer, int*); } void test_pointer(unbounded_array) { BOOST_TEST_TRAIT_SAME(boost::allocation_ptr >::pointer, int*); + BOOST_TEST_TRAIT_SAME(boost::allocation_ptr >::pointer, int*); + BOOST_TEST_TRAIT_SAME(boost::allocation_ptr >::pointer, int*); + BOOST_TEST_TRAIT_SAME(boost::allocation_ptr >::pointer, int*); } void test_pointer(bounded_array) { BOOST_TEST_TRAIT_SAME(boost::allocation_ptr >::pointer, int*); + BOOST_TEST_TRAIT_SAME(boost::allocation_ptr >::pointer, int*); + BOOST_TEST_TRAIT_SAME(boost::allocation_ptr >::pointer, int*); + BOOST_TEST_TRAIT_SAME(boost::allocation_ptr >::pointer, int*); } void test_element_type(scalar)