mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-07-29 20:37:13 +02:00
Remove uses of BOOST_SP_NO_SP_CONVERTIBLE
This commit is contained in:
@ -18,16 +18,6 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <cstddef>
|
||||
|
||||
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( BOOST_NO_SFINAE )
|
||||
# define BOOST_SP_NO_SP_CONVERTIBLE
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __GNUC__ ) && ( __GNUC__ * 100 + __GNUC_MINOR__ < 303 )
|
||||
# define BOOST_SP_NO_SP_CONVERTIBLE
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
@ -83,6 +73,4 @@ template< class Y, class T > struct sp_enable_if_convertible: public sp_enable_i
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // !defined( BOOST_SP_NO_SP_CONVERTIBLE )
|
||||
|
||||
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_CONVERTIBLE_HPP_INCLUDED
|
||||
|
@ -61,15 +61,7 @@ public:
|
||||
}
|
||||
|
||||
template<class U>
|
||||
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
|
||||
|
||||
intrusive_ptr( intrusive_ptr<U> const & rhs, typename boost::detail::sp_enable_if_convertible<U,T>::type = boost::detail::sp_empty() )
|
||||
|
||||
#else
|
||||
|
||||
intrusive_ptr( intrusive_ptr<U> const & rhs )
|
||||
|
||||
#endif
|
||||
: px( rhs.get() )
|
||||
{
|
||||
if( px != 0 ) intrusive_ptr_add_ref( px );
|
||||
@ -109,15 +101,7 @@ public:
|
||||
template<class U> friend class intrusive_ptr;
|
||||
|
||||
template<class U>
|
||||
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
|
||||
|
||||
intrusive_ptr(intrusive_ptr<U> && rhs, typename boost::detail::sp_enable_if_convertible<U,T>::type = boost::detail::sp_empty())
|
||||
|
||||
#else
|
||||
|
||||
intrusive_ptr(intrusive_ptr<U> && rhs)
|
||||
|
||||
#endif
|
||||
: px( rhs.px )
|
||||
{
|
||||
rhs.px = 0;
|
||||
|
@ -444,7 +444,7 @@ public:
|
||||
|
||||
// conversions to shared_ptr, weak_ptr
|
||||
|
||||
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
|
||||
#if !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
|
||||
template<class Y, class E = typename boost::detail::sp_enable_if_convertible<T,Y>::type> operator shared_ptr<Y>() const BOOST_SP_NOEXCEPT
|
||||
#else
|
||||
template<class Y> operator shared_ptr<Y>() const BOOST_SP_NOEXCEPT
|
||||
@ -462,7 +462,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
|
||||
#if !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
|
||||
template<class Y, class E = typename boost::detail::sp_enable_if_convertible<T,Y>::type> operator weak_ptr<Y>() const BOOST_SP_NOEXCEPT
|
||||
#else
|
||||
template<class Y> operator weak_ptr<Y>() const BOOST_SP_NOEXCEPT
|
||||
|
@ -111,15 +111,7 @@ public:
|
||||
// conversion
|
||||
|
||||
template<class Y>
|
||||
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
|
||||
|
||||
shared_array( shared_array<Y> const & r, typename boost::detail::sp_enable_if_convertible< Y[], T[] >::type = boost::detail::sp_empty() )
|
||||
|
||||
#else
|
||||
|
||||
shared_array( shared_array<Y> const & r )
|
||||
|
||||
#endif
|
||||
BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn )
|
||||
{
|
||||
boost::detail::sp_assert_convertible< Y[], T[] >();
|
||||
|
@ -211,18 +211,9 @@ template< class T, class R > struct sp_enable_if_auto_ptr< std::auto_ptr< T >, R
|
||||
|
||||
template< class Y, class T > inline void sp_assert_convertible() BOOST_SP_NOEXCEPT
|
||||
{
|
||||
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
|
||||
|
||||
// static_assert( sp_convertible< Y, T >::value );
|
||||
typedef char tmp[ sp_convertible< Y, T >::value? 1: -1 ];
|
||||
(void)sizeof( tmp );
|
||||
|
||||
#else
|
||||
|
||||
T* p = static_cast< Y* >( 0 );
|
||||
(void)p;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
// pointer constructor helper
|
||||
@ -426,15 +417,7 @@ public:
|
||||
}
|
||||
|
||||
template<class Y>
|
||||
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
|
||||
|
||||
shared_ptr( shared_ptr<Y> const & r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() )
|
||||
|
||||
#else
|
||||
|
||||
shared_ptr( shared_ptr<Y> const & r )
|
||||
|
||||
#endif
|
||||
BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn )
|
||||
{
|
||||
boost::detail::sp_assert_convertible< Y, T >();
|
||||
@ -614,15 +597,7 @@ public:
|
||||
}
|
||||
|
||||
template<class Y>
|
||||
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
|
||||
|
||||
shared_ptr( shared_ptr<Y> && r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() )
|
||||
|
||||
#else
|
||||
|
||||
shared_ptr( shared_ptr<Y> && r )
|
||||
|
||||
#endif
|
||||
BOOST_SP_NOEXCEPT : px( r.px ), pn( static_cast< boost::detail::shared_count && >( r.pn ) )
|
||||
{
|
||||
boost::detail::sp_assert_convertible< Y, T >();
|
||||
|
@ -74,15 +74,7 @@ public:
|
||||
//
|
||||
|
||||
template<class Y>
|
||||
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
|
||||
|
||||
weak_ptr( weak_ptr<Y> const & r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() )
|
||||
|
||||
#else
|
||||
|
||||
weak_ptr( weak_ptr<Y> const & r )
|
||||
|
||||
#endif
|
||||
BOOST_SP_NOEXCEPT : px(r.lock().get()), pn(r.pn)
|
||||
{
|
||||
boost::detail::sp_assert_convertible< Y, T >();
|
||||
@ -91,15 +83,7 @@ public:
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
template<class Y>
|
||||
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
|
||||
|
||||
weak_ptr( weak_ptr<Y> && r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() )
|
||||
|
||||
#else
|
||||
|
||||
weak_ptr( weak_ptr<Y> && r )
|
||||
|
||||
#endif
|
||||
BOOST_SP_NOEXCEPT : px( r.lock().get() ), pn( static_cast< boost::detail::weak_count && >( r.pn ) )
|
||||
{
|
||||
boost::detail::sp_assert_convertible< Y, T >();
|
||||
@ -124,15 +108,7 @@ public:
|
||||
#endif
|
||||
|
||||
template<class Y>
|
||||
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
|
||||
|
||||
weak_ptr( shared_ptr<Y> const & r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() )
|
||||
|
||||
#else
|
||||
|
||||
weak_ptr( shared_ptr<Y> const & r )
|
||||
|
||||
#endif
|
||||
BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn )
|
||||
{
|
||||
boost::detail::sp_assert_convertible< Y, T >();
|
||||
|
@ -78,8 +78,6 @@ using boost::weak_ptr;
|
||||
|
||||
int main()
|
||||
{
|
||||
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
|
||||
|
||||
TEST_CV_TRUE( X, X )
|
||||
TEST_CV_TRUE( X, void )
|
||||
TEST_CV_FALSE( void, X )
|
||||
@ -102,7 +100,5 @@ int main()
|
||||
TEST_CV_TRUE( X[3], void )
|
||||
TEST_CV_FALSE( void, X[3] )
|
||||
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ using boost::weak_ptr;
|
||||
|
||||
int main()
|
||||
{
|
||||
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
|
||||
#if !defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS)
|
||||
|
||||
TEST_CV_TRUE( X, X )
|
||||
TEST_CV_TRUE( X, void )
|
||||
|
@ -61,8 +61,6 @@ class D: public B
|
||||
|
||||
int main()
|
||||
{
|
||||
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
|
||||
|
||||
using boost::detail::sp_convertible;
|
||||
|
||||
TEST_CV_TRUE( X, X )
|
||||
@ -87,7 +85,5 @@ int main()
|
||||
TEST_CV_TRUE( X[3], void )
|
||||
TEST_CV_FALSE( void, X[3] )
|
||||
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -78,8 +78,6 @@ using boost::weak_ptr;
|
||||
|
||||
int main()
|
||||
{
|
||||
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
|
||||
|
||||
TEST_CV_TRUE( X, X )
|
||||
TEST_CV_TRUE( X, void )
|
||||
TEST_CV_FALSE( void, X )
|
||||
@ -102,7 +100,5 @@ int main()
|
||||
TEST_CV_TRUE( X[3], void )
|
||||
TEST_CV_FALSE( void, X[3] )
|
||||
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
Reference in New Issue
Block a user