diff --git a/include/boost/core/pointer_traits.hpp b/include/boost/core/pointer_traits.hpp index fbc76e7..7de7a8e 100644 --- a/include/boost/core/pointer_traits.hpp +++ b/include/boost/core/pointer_traits.hpp @@ -100,11 +100,19 @@ template struct ptr_rebind : ptr_transform { }; +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) template struct ptr_rebind >::type> { typedef typename T::template rebind type; }; +#else +template +struct ptr_rebind::other>::type> { + typedef typename T::template rebind::other type; +}; +#endif #if !defined(BOOST_NO_CXX11_DECLTYPE_N3276) template diff --git a/test/pointer_traits_rebind_sfinae_test.cpp b/test/pointer_traits_rebind_sfinae_test.cpp index d6ad087..8c7a1eb 100644 --- a/test/pointer_traits_rebind_sfinae_test.cpp +++ b/test/pointer_traits_rebind_sfinae_test.cpp @@ -56,7 +56,7 @@ struct P3 { typedef int element_type; template - struct rebind { }; + using rebind = P3; }; template diff --git a/test/pointer_traits_sfinae_test.cpp b/test/pointer_traits_sfinae_test.cpp index a7ae787..45c00d8 100644 --- a/test/pointer_traits_sfinae_test.cpp +++ b/test/pointer_traits_sfinae_test.cpp @@ -64,8 +64,15 @@ struct P2 { struct P3 { typedef int element_type; +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) template - struct rebind { }; + using rebind = P3; +#else + template + struct rebind { + typedef P3 other; + }; +#endif }; template