From 70ffd2921f14920cedcb722eeed8aa2fd10447cd Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 7 Dec 2013 19:20:36 +0200 Subject: [PATCH] Revert "Remove BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION" This reverts commit 8767b9580e415f44a285705a09f2dc097033f864. --- include/boost/smart_ptr/make_shared_object.hpp | 2 ++ include/boost/smart_ptr/shared_ptr.hpp | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/boost/smart_ptr/make_shared_object.hpp b/include/boost/smart_ptr/make_shared_object.hpp index 06875d9..52a00ce 100644 --- a/include/boost/smart_ptr/make_shared_object.hpp +++ b/include/boost/smart_ptr/make_shared_object.hpp @@ -107,6 +107,7 @@ template< class T > struct sp_if_not_array typedef boost::shared_ptr< T > type; }; +#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) template< class T > struct sp_if_not_array< T[] > { @@ -120,6 +121,7 @@ template< class T, std::size_t N > struct sp_if_not_array< T[N] > #endif +#endif } // namespace detail diff --git a/include/boost/smart_ptr/shared_ptr.hpp b/include/boost/smart_ptr/shared_ptr.hpp index 1bfecc7..a06d9e7 100644 --- a/include/boost/smart_ptr/shared_ptr.hpp +++ b/include/boost/smart_ptr/shared_ptr.hpp @@ -70,6 +70,7 @@ template< class T > struct sp_element typedef T type; }; +#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) template< class T > struct sp_element< T[] > { @@ -85,6 +86,7 @@ template< class T, std::size_t N > struct sp_element< T[N] > #endif +#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) // sp_dereference, return type of operator* @@ -117,6 +119,7 @@ template<> struct sp_dereference< void const volatile > #endif // !defined(BOOST_NO_CV_VOID_SPECIALIZATIONS) +#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) template< class T > struct sp_dereference< T[] > { @@ -132,6 +135,7 @@ template< class T, std::size_t N > struct sp_dereference< T[N] > #endif +#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) // sp_member_access, return type of operator-> @@ -140,6 +144,7 @@ template< class T > struct sp_member_access typedef T * type; }; +#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) template< class T > struct sp_member_access< T[] > { @@ -155,6 +160,7 @@ template< class T, std::size_t N > struct sp_member_access< T[N] > #endif +#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) // sp_array_access, return type of operator[] @@ -163,6 +169,7 @@ template< class T > struct sp_array_access typedef void type; }; +#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) template< class T > struct sp_array_access< T[] > { @@ -178,6 +185,7 @@ template< class T, std::size_t N > struct sp_array_access< T[N] > #endif +#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) // sp_extent, for operator[] index check @@ -186,12 +194,14 @@ template< class T > struct sp_extent enum _vt { value = 0 }; }; +#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) template< class T, std::size_t N > struct sp_extent< T[N] > { enum _vt { value = N }; }; +#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) // enable_shared_from_this support @@ -267,6 +277,7 @@ template< class T, class Y > inline void sp_pointer_construct( boost::shared_ptr boost::detail::sp_enable_shared_from_this( ppx, p, p ); } +#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) template< class T, class Y > inline void sp_pointer_construct( boost::shared_ptr< T[] > * /*ppx*/, Y * p, boost::detail::shared_count & pn ) { @@ -280,6 +291,7 @@ template< class T, std::size_t N, class Y > inline void sp_pointer_construct( bo boost::detail::shared_count( p, boost::checked_array_deleter< T >() ).swap( pn ); } +#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) // deleter constructor helper @@ -288,6 +300,7 @@ template< class T, class Y > inline void sp_deleter_construct( boost::shared_ptr boost::detail::sp_enable_shared_from_this( ppx, p, p ); } +#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) template< class T, class Y > inline void sp_deleter_construct( boost::shared_ptr< T[] > * /*ppx*/, Y * /*p*/ ) { @@ -299,6 +312,7 @@ template< class T, std::size_t N, class Y > inline void sp_deleter_construct( bo sp_assert_convertible< Y[N], T[N] >(); } +#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) } // namespace detail