From c132c339c795960cd5494f42e10df7c888cd1469 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 24 Sep 2024 18:41:46 +0300 Subject: [PATCH] Remove uses of BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION --- include/boost/smart_ptr/make_shared.hpp | 7 ++--- .../boost/smart_ptr/make_shared_object.hpp | 4 --- include/boost/smart_ptr/shared_ptr.hpp | 28 ------------------- 3 files changed, 2 insertions(+), 37 deletions(-) diff --git a/include/boost/smart_ptr/make_shared.hpp b/include/boost/smart_ptr/make_shared.hpp index dd9191c..1fdf6d6 100644 --- a/include/boost/smart_ptr/make_shared.hpp +++ b/include/boost/smart_ptr/make_shared.hpp @@ -12,10 +12,7 @@ // See http://www.boost.org/libs/smart_ptr/ for documentation. #include - -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined( BOOST_NO_SFINAE ) -# include -# include -#endif +#include +#include #endif // #ifndef BOOST_SMART_PTR_MAKE_SHARED_HPP_INCLUDED diff --git a/include/boost/smart_ptr/make_shared_object.hpp b/include/boost/smart_ptr/make_shared_object.hpp index 42b50e3..d9d4cb9 100644 --- a/include/boost/smart_ptr/make_shared_object.hpp +++ b/include/boost/smart_ptr/make_shared_object.hpp @@ -181,8 +181,6 @@ 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[] > { }; @@ -191,8 +189,6 @@ template< class T, std::size_t N > struct sp_if_not_array< T[N] > { }; -#endif - } // namespace detail #if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING ) diff --git a/include/boost/smart_ptr/shared_ptr.hpp b/include/boost/smart_ptr/shared_ptr.hpp index b61b443..22b2d28 100644 --- a/include/boost/smart_ptr/shared_ptr.hpp +++ b/include/boost/smart_ptr/shared_ptr.hpp @@ -66,8 +66,6 @@ template< class T > struct sp_element typedef T type; }; -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - template< class T > struct sp_element< T[] > { typedef T type; @@ -78,8 +76,6 @@ template< class T, std::size_t N > struct sp_element< T[N] > typedef T type; }; -#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - // sp_dereference, return type of operator* template< class T > struct sp_dereference @@ -107,8 +103,6 @@ template<> struct sp_dereference< void const volatile > typedef void type; }; -#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - template< class T > struct sp_dereference< T[] > { typedef void type; @@ -119,8 +113,6 @@ template< class T, std::size_t N > struct sp_dereference< T[N] > typedef void type; }; -#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - // sp_member_access, return type of operator-> template< class T > struct sp_member_access @@ -128,8 +120,6 @@ 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[] > { typedef void type; @@ -140,8 +130,6 @@ template< class T, std::size_t N > struct sp_member_access< T[N] > typedef void type; }; -#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - // sp_array_access, return type of operator[] template< class T > struct sp_array_access @@ -149,8 +137,6 @@ 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[] > { typedef T & type; @@ -161,8 +147,6 @@ template< class T, std::size_t N > struct sp_array_access< T[N] > typedef T & type; }; -#endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) - // sp_extent, for operator[] index check template< class T > struct sp_extent @@ -170,15 +154,11 @@ 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 template< class X, class Y, class T > inline void sp_enable_shared_from_this( boost::shared_ptr const * ppx, Y const * py, boost::enable_shared_from_this< T > const * pe ) @@ -253,8 +233,6 @@ 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 ) { sp_assert_convertible< Y[], T[] >(); @@ -267,8 +245,6 @@ 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 template< class T, class Y > inline void sp_deleter_construct( boost::shared_ptr< T > * ppx, Y * p ) @@ -276,8 +252,6 @@ 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*/ ) { sp_assert_convertible< Y[], T[] >(); @@ -288,8 +262,6 @@ 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 ) - struct sp_internal_constructor_tag { };