From b104d85d95f8793b7496aded52ba22cbceadf3e9 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 20 Jun 2017 05:36:47 +0300 Subject: [PATCH] Fix use of allocator_traits --- .../smart_ptr/make_local_shared_object.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/boost/smart_ptr/make_local_shared_object.hpp b/include/boost/smart_ptr/make_local_shared_object.hpp index c8a2330..4d76e29 100644 --- a/include/boost/smart_ptr/make_local_shared_object.hpp +++ b/include/boost/smart_ptr/make_local_shared_object.hpp @@ -113,7 +113,16 @@ public: template typename boost::detail::lsp_if_not_array::type allocate_local_shared( A const & a, Args&&... args ) { +#if !defined( BOOST_NO_CXX11_ALLOCATOR ) + typedef typename std::allocator_traits::template rebind_alloc A2; + +#else + + typedef typename A::template rebind::other A2; + +#endif + A2 a2( a ); typedef boost::detail::lsp_ms_deleter D; @@ -145,7 +154,16 @@ template typename boost::detail::lsp_if_not_arr template typename boost::detail::lsp_if_not_array::type allocate_local_shared_noinit( A const & a ) { +#if !defined( BOOST_NO_CXX11_ALLOCATOR ) + typedef typename std::allocator_traits::template rebind_alloc A2; + +#else + + typedef typename A::template rebind::other A2; + +#endif + A2 a2( a ); typedef boost::detail::lsp_ms_deleter D;