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;