From 569b07b91cc56872a8ad22d6b0ac9b4ef7d8c954 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 24 Sep 2024 19:05:48 +0300 Subject: [PATCH] Remove uses of BOOST_NO_CXX11_NULLPTR --- include/boost/smart_ptr/allocate_unique.hpp | 22 ++++------ .../smart_ptr/detail/local_sp_deleter.hpp | 6 +-- .../boost/smart_ptr/detail/sp_nullptr_t.hpp | 4 -- include/boost/smart_ptr/intrusive_ptr.hpp | 12 ++---- include/boost/smart_ptr/local_shared_ptr.hpp | 38 +++++------------- include/boost/smart_ptr/scoped_array.hpp | 12 ++---- include/boost/smart_ptr/scoped_ptr.hpp | 12 ++---- include/boost/smart_ptr/shared_array.hpp | 18 +++------ include/boost/smart_ptr/shared_ptr.hpp | 40 +++++-------------- test/local_sp_test.cpp | 34 ---------------- test/sa_nullptr_test.cpp | 11 ----- test/sp_constexpr_test.cpp | 10 +---- test/sp_move_only_deleter.cpp | 4 -- test/sp_nullptr_test.cpp | 11 ----- 14 files changed, 45 insertions(+), 189 deletions(-) diff --git a/include/boost/smart_ptr/allocate_unique.hpp b/include/boost/smart_ptr/allocate_unique.hpp index 07cc2bf..fc3896e 100644 --- a/include/boost/smart_ptr/allocate_unique.hpp +++ b/include/boost/smart_ptr/allocate_unique.hpp @@ -78,10 +78,8 @@ public: sp_alloc_ptr(std::size_t, P p) BOOST_SP_NOEXCEPT : p_(p) { } -#if !defined(BOOST_NO_CXX11_NULLPTR) - sp_alloc_ptr(detail::sp_nullptr_t) BOOST_SP_NOEXCEPT + sp_alloc_ptr(std::nullptr_t) BOOST_SP_NOEXCEPT : p_() { } -#endif T& operator*() const { return *p_; @@ -133,10 +131,8 @@ public: : p_(p) , n_(n) { } -#if !defined(BOOST_NO_CXX11_NULLPTR) - sp_alloc_ptr(detail::sp_nullptr_t) BOOST_SP_NOEXCEPT + sp_alloc_ptr(std::nullptr_t) BOOST_SP_NOEXCEPT : p_() { } -#endif T& operator[](std::size_t i) const { return p_[i]; @@ -184,10 +180,8 @@ public: sp_alloc_ptr(std::size_t, P p) BOOST_SP_NOEXCEPT : p_(p) { } -#if !defined(BOOST_NO_CXX11_NULLPTR) - sp_alloc_ptr(detail::sp_nullptr_t) BOOST_SP_NOEXCEPT + sp_alloc_ptr(std::nullptr_t) BOOST_SP_NOEXCEPT : p_() { } -#endif T& operator[](std::size_t i) const { return p_[i]; @@ -237,18 +231,17 @@ operator!=(const sp_alloc_ptr& lhs, const sp_alloc_ptr& rhs) return !(lhs == rhs); } -#if !defined(BOOST_NO_CXX11_NULLPTR) template inline bool operator==(const sp_alloc_ptr& lhs, - detail::sp_nullptr_t) BOOST_SP_NOEXCEPT + std::nullptr_t) BOOST_SP_NOEXCEPT { return !lhs.ptr(); } template inline bool -operator==(detail::sp_nullptr_t, +operator==(std::nullptr_t, const sp_alloc_ptr& rhs) BOOST_SP_NOEXCEPT { return !rhs.ptr(); @@ -257,19 +250,18 @@ operator==(detail::sp_nullptr_t, template inline bool operator!=(const sp_alloc_ptr& lhs, - detail::sp_nullptr_t) BOOST_SP_NOEXCEPT + std::nullptr_t) BOOST_SP_NOEXCEPT { return !!lhs.ptr(); } template inline bool -operator!=(detail::sp_nullptr_t, +operator!=(std::nullptr_t, const sp_alloc_ptr& rhs) BOOST_SP_NOEXCEPT { return !!rhs.ptr(); } -#endif template inline void diff --git a/include/boost/smart_ptr/detail/local_sp_deleter.hpp b/include/boost/smart_ptr/detail/local_sp_deleter.hpp index 9ede7e3..bceb568 100644 --- a/include/boost/smart_ptr/detail/local_sp_deleter.hpp +++ b/include/boost/smart_ptr/detail/local_sp_deleter.hpp @@ -60,14 +60,10 @@ public: d_( p ); } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - - void operator()( boost::detail::sp_nullptr_t p ) BOOST_SP_NOEXCEPT + void operator()( std::nullptr_t p ) BOOST_SP_NOEXCEPT { d_( p ); } - -#endif }; template<> class local_sp_deleter diff --git a/include/boost/smart_ptr/detail/sp_nullptr_t.hpp b/include/boost/smart_ptr/detail/sp_nullptr_t.hpp index 219ae80..e877481 100644 --- a/include/boost/smart_ptr/detail/sp_nullptr_t.hpp +++ b/include/boost/smart_ptr/detail/sp_nullptr_t.hpp @@ -18,8 +18,6 @@ #include #include -#if !defined( BOOST_NO_CXX11_NULLPTR ) - namespace boost { @@ -40,6 +38,4 @@ namespace detail } // namespace boost -#endif // !defined( BOOST_NO_CXX11_NULLPTR ) - #endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_NULLPTR_T_HPP_INCLUDED diff --git a/include/boost/smart_ptr/intrusive_ptr.hpp b/include/boost/smart_ptr/intrusive_ptr.hpp index fa260ba..c76680d 100644 --- a/include/boost/smart_ptr/intrusive_ptr.hpp +++ b/include/boost/smart_ptr/intrusive_ptr.hpp @@ -212,30 +212,26 @@ template inline bool operator!=(T * a, intrusive_ptr const return a != b.get(); } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - -template inline bool operator==( intrusive_ptr const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template inline bool operator==( intrusive_ptr const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT { return p.get() == 0; } -template inline bool operator==( boost::detail::sp_nullptr_t, intrusive_ptr const & p ) BOOST_SP_NOEXCEPT +template inline bool operator==( std::nullptr_t, intrusive_ptr const & p ) BOOST_SP_NOEXCEPT { return p.get() == 0; } -template inline bool operator!=( intrusive_ptr const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template inline bool operator!=( intrusive_ptr const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT { return p.get() != 0; } -template inline bool operator!=( boost::detail::sp_nullptr_t, intrusive_ptr const & p ) BOOST_SP_NOEXCEPT +template inline bool operator!=( std::nullptr_t, intrusive_ptr const & p ) BOOST_SP_NOEXCEPT { return p.get() != 0; } -#endif - template inline bool operator<(intrusive_ptr const & a, intrusive_ptr const & b) BOOST_SP_NOEXCEPT { return std::less()(a.get(), b.get()); diff --git a/include/boost/smart_ptr/local_shared_ptr.hpp b/include/boost/smart_ptr/local_shared_ptr.hpp index b7a8043..6c12257 100644 --- a/include/boost/smart_ptr/local_shared_ptr.hpp +++ b/include/boost/smart_ptr/local_shared_ptr.hpp @@ -140,14 +140,10 @@ public: { } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - - BOOST_CONSTEXPR local_shared_ptr( boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT : px( 0 ), pn( 0 ) + BOOST_CONSTEXPR local_shared_ptr( std::nullptr_t ) BOOST_SP_NOEXCEPT : px( 0 ), pn( 0 ) { } -#endif - // internal constructor, used by make_shared BOOST_CONSTEXPR local_shared_ptr( boost::detail::lsp_internal_constructor_tag, element_type * px_, boost::detail::local_counted_base * pn_ ) BOOST_SP_NOEXCEPT : px( px_ ), pn( pn_ ) { @@ -164,29 +160,21 @@ public: boost::detail::lsp_deleter_construct( this, p, d, pn ); } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - - template local_shared_ptr( boost::detail::sp_nullptr_t p, D d ): px( p ), pn( 0 ) + template local_shared_ptr( std::nullptr_t p, D d ): px( p ), pn( 0 ) { boost::detail::lsp_deleter_construct( this, p, d, pn ); } -#endif - template local_shared_ptr( Y * p, D d, A a ): px( p ), pn( 0 ) { boost::detail::lsp_allocator_construct( this, p, d, a, pn ); } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - - template local_shared_ptr( boost::detail::sp_nullptr_t p, D d, A a ): px( p ), pn( 0 ) + template local_shared_ptr( std::nullptr_t p, D d, A a ): px( p ), pn( 0 ) { boost::detail::lsp_allocator_construct( this, p, d, a, pn ); } -#endif - // construction from shared_ptr template local_shared_ptr( shared_ptr const & r, @@ -349,17 +337,13 @@ public: #endif -#if !defined( BOOST_NO_CXX11_NULLPTR ) - - local_shared_ptr & operator=( boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT + local_shared_ptr & operator=( std::nullptr_t ) BOOST_SP_NOEXCEPT { local_shared_ptr().swap(*this); return *this; } -#endif - -#if !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) +#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) template local_shared_ptr & operator=( std::unique_ptr && r ) @@ -513,30 +497,26 @@ template inline bool operator!=( local_shared_ptr const & a return a.get() != b.get(); } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - -template inline bool operator==( local_shared_ptr const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template inline bool operator==( local_shared_ptr const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT { return p.get() == 0; } -template inline bool operator==( boost::detail::sp_nullptr_t, local_shared_ptr const & p ) BOOST_SP_NOEXCEPT +template inline bool operator==( std::nullptr_t, local_shared_ptr const & p ) BOOST_SP_NOEXCEPT { return p.get() == 0; } -template inline bool operator!=( local_shared_ptr const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template inline bool operator!=( local_shared_ptr const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT { return p.get() != 0; } -template inline bool operator!=( boost::detail::sp_nullptr_t, local_shared_ptr const & p ) BOOST_SP_NOEXCEPT +template inline bool operator!=( std::nullptr_t, local_shared_ptr const & p ) BOOST_SP_NOEXCEPT { return p.get() != 0; } -#endif - template inline bool operator==( local_shared_ptr const & a, shared_ptr const & b ) BOOST_SP_NOEXCEPT { return a.get() == b.get(); diff --git a/include/boost/smart_ptr/scoped_array.hpp b/include/boost/smart_ptr/scoped_array.hpp index 4066b73..9051292 100644 --- a/include/boost/smart_ptr/scoped_array.hpp +++ b/include/boost/smart_ptr/scoped_array.hpp @@ -98,30 +98,26 @@ public: } }; -#if !defined( BOOST_NO_CXX11_NULLPTR ) - -template inline bool operator==( scoped_array const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template inline bool operator==( scoped_array const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT { return p.get() == 0; } -template inline bool operator==( boost::detail::sp_nullptr_t, scoped_array const & p ) BOOST_SP_NOEXCEPT +template inline bool operator==( std::nullptr_t, scoped_array const & p ) BOOST_SP_NOEXCEPT { return p.get() == 0; } -template inline bool operator!=( scoped_array const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template inline bool operator!=( scoped_array const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT { return p.get() != 0; } -template inline bool operator!=( boost::detail::sp_nullptr_t, scoped_array const & p ) BOOST_SP_NOEXCEPT +template inline bool operator!=( std::nullptr_t, scoped_array const & p ) BOOST_SP_NOEXCEPT { return p.get() != 0; } -#endif - template inline void swap(scoped_array & a, scoped_array & b) BOOST_SP_NOEXCEPT { a.swap(b); diff --git a/include/boost/smart_ptr/scoped_ptr.hpp b/include/boost/smart_ptr/scoped_ptr.hpp index 4ea7642..1e2f3a9 100644 --- a/include/boost/smart_ptr/scoped_ptr.hpp +++ b/include/boost/smart_ptr/scoped_ptr.hpp @@ -122,30 +122,26 @@ public: } }; -#if !defined( BOOST_NO_CXX11_NULLPTR ) - -template inline bool operator==( scoped_ptr const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template inline bool operator==( scoped_ptr const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT { return p.get() == 0; } -template inline bool operator==( boost::detail::sp_nullptr_t, scoped_ptr const & p ) BOOST_SP_NOEXCEPT +template inline bool operator==( std::nullptr_t, scoped_ptr const & p ) BOOST_SP_NOEXCEPT { return p.get() == 0; } -template inline bool operator!=( scoped_ptr const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template inline bool operator!=( scoped_ptr const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT { return p.get() != 0; } -template inline bool operator!=( boost::detail::sp_nullptr_t, scoped_ptr const & p ) BOOST_SP_NOEXCEPT +template inline bool operator!=( std::nullptr_t, scoped_ptr const & p ) BOOST_SP_NOEXCEPT { return p.get() != 0; } -#endif - template inline void swap(scoped_ptr & a, scoped_ptr & b) BOOST_SP_NOEXCEPT { a.swap(b); diff --git a/include/boost/smart_ptr/shared_array.hpp b/include/boost/smart_ptr/shared_array.hpp index 221119a..557b07c 100644 --- a/include/boost/smart_ptr/shared_array.hpp +++ b/include/boost/smart_ptr/shared_array.hpp @@ -58,14 +58,10 @@ public: { } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - - shared_array( boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT : px( 0 ), pn() + shared_array( std::nullptr_t ) BOOST_SP_NOEXCEPT : px( 0 ), pn() { } -#endif - template explicit shared_array( Y * p ): px( p ), pn( p, checked_array_deleter() ) { @@ -237,30 +233,26 @@ template inline bool operator!=(shared_array const & a, shared_array return a.get() != b.get(); } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - -template inline bool operator==( shared_array const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template inline bool operator==( shared_array const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT { return p.get() == 0; } -template inline bool operator==( boost::detail::sp_nullptr_t, shared_array const & p ) BOOST_SP_NOEXCEPT +template inline bool operator==( std::nullptr_t, shared_array const & p ) BOOST_SP_NOEXCEPT { return p.get() == 0; } -template inline bool operator!=( shared_array const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template inline bool operator!=( shared_array const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT { return p.get() != 0; } -template inline bool operator!=( boost::detail::sp_nullptr_t, shared_array const & p ) BOOST_SP_NOEXCEPT +template inline bool operator!=( std::nullptr_t, shared_array const & p ) BOOST_SP_NOEXCEPT { return p.get() != 0; } -#endif - template inline bool operator<(shared_array const & a, shared_array const & b) BOOST_SP_NOEXCEPT { return std::less()(a.get(), b.get()); diff --git a/include/boost/smart_ptr/shared_ptr.hpp b/include/boost/smart_ptr/shared_ptr.hpp index 5ab1b0e..8fb02ba 100644 --- a/include/boost/smart_ptr/shared_ptr.hpp +++ b/include/boost/smart_ptr/shared_ptr.hpp @@ -283,14 +283,10 @@ public: { } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - - BOOST_CONSTEXPR shared_ptr( boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT : px( 0 ), pn() + BOOST_CONSTEXPR shared_ptr( std::nullptr_t ) BOOST_SP_NOEXCEPT : px( 0 ), pn() { } -#endif - BOOST_CONSTEXPR shared_ptr( boost::detail::sp_internal_constructor_tag, element_type * px_, boost::detail::shared_count const & pn_ ) BOOST_SP_NOEXCEPT : px( px_ ), pn( pn_ ) { } @@ -331,22 +327,18 @@ public: #endif -#if !defined( BOOST_NO_CXX11_NULLPTR ) - #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - template shared_ptr( boost::detail::sp_nullptr_t p, D d ): px( p ), pn( p, static_cast< D&& >( d ) ) + template shared_ptr( std::nullptr_t p, D d ): px( p ), pn( p, static_cast< D&& >( d ) ) { } #else - template shared_ptr( boost::detail::sp_nullptr_t p, D d ): px( p ), pn( p, d ) + template shared_ptr( std::nullptr_t p, D d ): px( p ), pn( p, d ) { } -#endif - #endif // As above, but with allocator. A's copy constructor shall not throw. @@ -367,24 +359,20 @@ public: #endif -#if !defined( BOOST_NO_CXX11_NULLPTR ) - #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - template shared_ptr( boost::detail::sp_nullptr_t p, D d, A a ): px( p ), pn( p, static_cast< D&& >( d ), a ) + template shared_ptr( std::nullptr_t p, D d, A a ): px( p ), pn( p, static_cast< D&& >( d ), a ) { } #else - template shared_ptr( boost::detail::sp_nullptr_t p, D d, A a ): px( p ), pn( p, d, a ) + template shared_ptr( std::nullptr_t p, D d, A a ): px( p ), pn( p, d, a ) { } #endif -#endif - // generated copy constructor, destructor are fine... #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) @@ -627,16 +615,12 @@ public: #endif -#if !defined( BOOST_NO_CXX11_NULLPTR ) - - shared_ptr & operator=( boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT + shared_ptr & operator=( std::nullptr_t ) BOOST_SP_NOEXCEPT { this_type().swap(*this); return *this; } -#endif - void reset() BOOST_SP_NOEXCEPT { this_type().swap(*this); @@ -803,30 +787,26 @@ template inline bool operator!=(shared_ptr const & a, share return a.get() != b.get(); } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - -template inline bool operator==( shared_ptr const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template inline bool operator==( shared_ptr const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT { return p.get() == 0; } -template inline bool operator==( boost::detail::sp_nullptr_t, shared_ptr const & p ) BOOST_SP_NOEXCEPT +template inline bool operator==( std::nullptr_t, shared_ptr const & p ) BOOST_SP_NOEXCEPT { return p.get() == 0; } -template inline bool operator!=( shared_ptr const & p, boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT +template inline bool operator!=( shared_ptr const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT { return p.get() != 0; } -template inline bool operator!=( boost::detail::sp_nullptr_t, shared_ptr const & p ) BOOST_SP_NOEXCEPT +template inline bool operator!=( std::nullptr_t, shared_ptr const & p ) BOOST_SP_NOEXCEPT { return p.get() != 0; } -#endif - template inline bool operator<(shared_ptr const & a, shared_ptr const & b) BOOST_SP_NOEXCEPT { return a.owner_before( b ); diff --git a/test/local_sp_test.cpp b/test/local_sp_test.cpp index dc0e316..d0262b3 100644 --- a/test/local_sp_test.cpp +++ b/test/local_sp_test.cpp @@ -78,8 +78,6 @@ static void default_constructor() static void nullptr_constructor() { -#if !defined( BOOST_NO_CXX11_NULLPTR ) - { boost::local_shared_ptr p( nullptr ); @@ -112,8 +110,6 @@ static void nullptr_constructor() BOOST_TEST_EQ( p.get(), static_cast(0) ); BOOST_TEST_EQ( p.local_use_count(), 0 ); } - -#endif } // pointer constructor @@ -226,8 +222,6 @@ static void deleter_constructor() // nullptr_deleter_constructor -#if !defined( BOOST_NO_CXX11_NULLPTR ) - void deleter3( boost::detail::sp_nullptr_t ) { ++m; @@ -260,14 +254,6 @@ static void nullptr_deleter_constructor() deleter3_test_(); } -#else - -static void nullptr_deleter_constructor() -{ -} - -#endif - // allocator constructor template static void allocator_test_() @@ -300,8 +286,6 @@ static void allocator_constructor() // nullptr_allocator_constructor -#if !defined( BOOST_NO_CXX11_NULLPTR ) - template static void allocator3_test_() { { @@ -329,14 +313,6 @@ static void nullptr_allocator_constructor() allocator3_test_(); } -#else - -static void nullptr_allocator_constructor() -{ -} - -#endif - // copy constructor template static void empty_copy_test() @@ -1253,8 +1229,6 @@ static void move_assignment() // nullptr assignment -#if !defined( BOOST_NO_CXX11_NULLPTR ) - template static void test_nullptr_assign( boost::local_shared_ptr p1 ) { p1 = nullptr; @@ -1307,14 +1281,6 @@ static void nullptr_assignment() BOOST_TEST( X::instances == 0 ); } -#else - -static void nullptr_assignment() -{ -} - -#endif - // default_reset template static void test_default_reset( boost::local_shared_ptr p1 ) diff --git a/test/sa_nullptr_test.cpp b/test/sa_nullptr_test.cpp index bec0161..5ef9166 100644 --- a/test/sa_nullptr_test.cpp +++ b/test/sa_nullptr_test.cpp @@ -13,8 +13,6 @@ #include #include -#if !defined( BOOST_NO_CXX11_NULLPTR ) - struct X { static int instances; @@ -101,12 +99,3 @@ int main() return boost::report_errors(); } - -#else - -int main() -{ - return 0; -} - -#endif diff --git a/test/sp_constexpr_test.cpp b/test/sp_constexpr_test.cpp index 67d6b37..da6c82e 100644 --- a/test/sp_constexpr_test.cpp +++ b/test/sp_constexpr_test.cpp @@ -52,17 +52,13 @@ static Z z; static boost::shared_ptr p1; static boost::weak_ptr p2; -#if !defined( BOOST_NO_CXX11_NULLPTR ) - static boost::shared_ptr p3( nullptr ); -#endif +static boost::shared_ptr p3( nullptr ); Z::Z() { p1.reset( new X ); p2 = p1; -#if !defined( BOOST_NO_CXX11_NULLPTR ) p3.reset( new X ); -#endif } int main() @@ -73,13 +69,9 @@ int main() BOOST_TEST_EQ( p2.use_count(), 1 ); BOOST_TEST_EQ( p2.lock(), p1 ); -#if !defined( BOOST_NO_CXX11_NULLPTR ) - BOOST_TEST( p3.get() != 0 ); BOOST_TEST_EQ( p3.use_count(), 1 ); -#endif - return boost::report_errors(); } diff --git a/test/sp_move_only_deleter.cpp b/test/sp_move_only_deleter.cpp index 8154ec5..677cacc 100644 --- a/test/sp_move_only_deleter.cpp +++ b/test/sp_move_only_deleter.cpp @@ -125,8 +125,6 @@ int main() BOOST_TEST( Y::instances == 0 ); } -#if !defined( BOOST_NO_CXX11_NULLPTR ) - { boost::shared_ptr p( nullptr, YD() ); @@ -145,8 +143,6 @@ int main() BOOST_TEST( del.moved_ ); } -#endif - return boost::report_errors(); } diff --git a/test/sp_nullptr_test.cpp b/test/sp_nullptr_test.cpp index eadf527..341465b 100644 --- a/test/sp_nullptr_test.cpp +++ b/test/sp_nullptr_test.cpp @@ -14,8 +14,6 @@ #include #include -#if !defined( BOOST_NO_CXX11_NULLPTR ) - struct X { static int instances; @@ -130,12 +128,3 @@ int main() return boost::report_errors(); } - -#else - -int main() -{ - return 0; -} - -#endif