summaryrefslogtreecommitdiff
path: root/boost/smart_ptr
diff options
context:
space:
mode:
Diffstat (limited to 'boost/smart_ptr')
-rw-r--r--boost/smart_ptr/allocate_local_shared_array.hpp1
-rw-r--r--boost/smart_ptr/allocate_shared_array.hpp1
-rw-r--r--boost/smart_ptr/allocate_unique.hpp12
-rw-r--r--boost/smart_ptr/atomic_shared_ptr.hpp1
-rw-r--r--boost/smart_ptr/detail/requires_cxx11.hpp23
-rw-r--r--boost/smart_ptr/detail/shared_count.hpp2
-rw-r--r--boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp6
-rw-r--r--boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp2
-rw-r--r--boost/smart_ptr/detail/sp_counted_impl.hpp2
-rw-r--r--boost/smart_ptr/detail/sp_thread_pause.hpp40
-rw-r--r--boost/smart_ptr/detail/sp_thread_sleep.hpp93
-rw-r--r--boost/smart_ptr/detail/sp_thread_yield.hpp89
-rw-r--r--boost/smart_ptr/detail/sp_win32_sleep.hpp49
-rw-r--r--boost/smart_ptr/detail/spinlock_gcc_atomic.hpp13
-rw-r--r--boost/smart_ptr/detail/yield_k.hpp10
-rw-r--r--boost/smart_ptr/enable_shared_from.hpp1
-rw-r--r--boost/smart_ptr/enable_shared_from_this.hpp1
-rw-r--r--boost/smart_ptr/intrusive_ptr.hpp4
-rw-r--r--boost/smart_ptr/local_shared_ptr.hpp1
-rw-r--r--boost/smart_ptr/make_local_shared.hpp1
-rw-r--r--boost/smart_ptr/make_local_shared_array.hpp1
-rw-r--r--boost/smart_ptr/make_local_shared_object.hpp1
-rw-r--r--boost/smart_ptr/make_shared.hpp1
-rw-r--r--boost/smart_ptr/make_shared_array.hpp1
-rw-r--r--boost/smart_ptr/make_shared_object.hpp1
-rw-r--r--boost/smart_ptr/make_unique.hpp1
-rw-r--r--boost/smart_ptr/scoped_array.hpp3
-rw-r--r--boost/smart_ptr/scoped_ptr.hpp3
-rw-r--r--boost/smart_ptr/shared_array.hpp4
-rw-r--r--boost/smart_ptr/shared_ptr.hpp10
-rw-r--r--boost/smart_ptr/weak_ptr.hpp1
31 files changed, 102 insertions, 277 deletions
diff --git a/boost/smart_ptr/allocate_local_shared_array.hpp b/boost/smart_ptr/allocate_local_shared_array.hpp
index fd87329695..72ecfcf8a9 100644
--- a/boost/smart_ptr/allocate_local_shared_array.hpp
+++ b/boost/smart_ptr/allocate_local_shared_array.hpp
@@ -8,6 +8,7 @@ Distributed under the Boost Software License, Version 1.0.
#ifndef BOOST_SMART_PTR_ALLOCATE_LOCAL_SHARED_ARRAY_HPP
#define BOOST_SMART_PTR_ALLOCATE_LOCAL_SHARED_ARRAY_HPP
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
#include <boost/smart_ptr/allocate_shared_array.hpp>
#include <boost/smart_ptr/local_shared_ptr.hpp>
diff --git a/boost/smart_ptr/allocate_shared_array.hpp b/boost/smart_ptr/allocate_shared_array.hpp
index 5f00d91e18..f07702bdbb 100644
--- a/boost/smart_ptr/allocate_shared_array.hpp
+++ b/boost/smart_ptr/allocate_shared_array.hpp
@@ -8,6 +8,7 @@ Distributed under the Boost Software License, Version 1.0.
#ifndef BOOST_SMART_PTR_ALLOCATE_SHARED_ARRAY_HPP
#define BOOST_SMART_PTR_ALLOCATE_SHARED_ARRAY_HPP
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
#include <boost/core/allocator_access.hpp>
#include <boost/core/alloc_construct.hpp>
#include <boost/core/first_scalar.hpp>
diff --git a/boost/smart_ptr/allocate_unique.hpp b/boost/smart_ptr/allocate_unique.hpp
index 3738b38382..412b344230 100644
--- a/boost/smart_ptr/allocate_unique.hpp
+++ b/boost/smart_ptr/allocate_unique.hpp
@@ -1,5 +1,5 @@
/*
-Copyright 2019 Glen Joseph Fernandes
+Copyright 2019-2021 Glen Joseph Fernandes
(glenjofe@gmail.com)
Distributed under the Boost Software License, Version 1.0.
@@ -8,6 +8,7 @@ Distributed under the Boost Software License, Version 1.0.
#ifndef BOOST_SMART_PTR_ALLOCATE_UNIQUE_HPP
#define BOOST_SMART_PTR_ALLOCATE_UNIQUE_HPP
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
#include <boost/core/allocator_access.hpp>
@@ -477,6 +478,15 @@ allocate_unique(const A& alloc,
return c.release();
}
+template<class T, class U, class A>
+inline typename allocator_pointer<typename allocator_rebind<A,
+ typename detail::sp_alloc_value<T>::type>::type>::type
+get_allocator_pointer(const std::unique_ptr<T,
+ alloc_deleter<U, A> >& p) BOOST_NOEXCEPT
+{
+ return p.get().ptr();
+}
+
} /* boost */
#endif
diff --git a/boost/smart_ptr/atomic_shared_ptr.hpp b/boost/smart_ptr/atomic_shared_ptr.hpp
index b863100e53..d855e5a877 100644
--- a/boost/smart_ptr/atomic_shared_ptr.hpp
+++ b/boost/smart_ptr/atomic_shared_ptr.hpp
@@ -13,6 +13,7 @@
// See http://www.boost.org/libs/smart_ptr/ for documentation.
//
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/smart_ptr/detail/spinlock.hpp>
#include <cstring>
diff --git a/boost/smart_ptr/detail/requires_cxx11.hpp b/boost/smart_ptr/detail/requires_cxx11.hpp
new file mode 100644
index 0000000000..732cc40394
--- /dev/null
+++ b/boost/smart_ptr/detail/requires_cxx11.hpp
@@ -0,0 +1,23 @@
+#ifndef BOOST_SMART_PTR_DETAIL_REQUIRES_CXX11_HPP_INCLUDED
+#define BOOST_SMART_PTR_DETAIL_REQUIRES_CXX11_HPP_INCLUDED
+
+// Copyright 2023 Peter Dimov
+// Distributed under the Boost Software License, Version 1.0.
+// https://www.boost.org/LICENSE_1_0.txt
+
+#include <boost/config.hpp>
+#include <boost/config/pragma_message.hpp>
+
+#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || \
+ defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
+ defined(BOOST_NO_CXX11_DECLTYPE) || \
+ defined(BOOST_NO_CXX11_CONSTEXPR) || \
+ defined(BOOST_NO_CXX11_NOEXCEPT) || \
+ defined(BOOST_NO_CXX11_NULLPTR) || \
+ defined(BOOST_NO_CXX11_SMART_PTR)
+
+BOOST_PRAGMA_MESSAGE("C++03 support was deprecated in Boost.SmartPtr 1.82 and will be removed in Boost.SmartPtr 1.84. Please open an issue in https://github.com/boostorg/smart_ptr if you want it retained.")
+
+#endif
+
+#endif // #ifndef BOOST_SMART_PTR_DETAIL_REQUIRES_CXX11_HPP_INCLUDED
diff --git a/boost/smart_ptr/detail/shared_count.hpp b/boost/smart_ptr/detail/shared_count.hpp
index 73a33ffeb0..c6fe1bb2d1 100644
--- a/boost/smart_ptr/detail/shared_count.hpp
+++ b/boost/smart_ptr/detail/shared_count.hpp
@@ -27,7 +27,7 @@
#include <boost/smart_ptr/detail/sp_counted_impl.hpp>
#include <boost/smart_ptr/detail/sp_disable_deprecated.hpp>
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
-#include <boost/checked_delete.hpp>
+#include <boost/core/checked_delete.hpp>
#include <boost/throw_exception.hpp>
#include <boost/core/addressof.hpp>
#include <boost/config.hpp>
diff --git a/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp b/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp
index 81387ce99b..58a69e6c06 100644
--- a/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp
+++ b/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp
@@ -35,8 +35,6 @@ BOOST_PRAGMA_MESSAGE("Using CodeWarrior/PowerPC sp_counted_base")
#endif
-BOOST_SP_OBSOLETE()
-
namespace boost
{
@@ -64,7 +62,11 @@ inline long atomic_decrement( register long * pw )
asm
{
+#if defined(__PPCZen__) || defined(__PPCe500__) || defined(__PPCe500v2__)
+ msync
+#else
sync
+#endif
loop:
diff --git a/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp b/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp
index 99ded0d4f2..57de800661 100644
--- a/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp
+++ b/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp
@@ -137,7 +137,7 @@ public:
long use_count() const // nothrow
{
- return atomic_load( &use_count_ );
+ return static_cast<long>( atomic_load( &use_count_ ) );
}
};
diff --git a/boost/smart_ptr/detail/sp_counted_impl.hpp b/boost/smart_ptr/detail/sp_counted_impl.hpp
index b21685e83f..8c12ac908e 100644
--- a/boost/smart_ptr/detail/sp_counted_impl.hpp
+++ b/boost/smart_ptr/detail/sp_counted_impl.hpp
@@ -24,7 +24,7 @@
#include <boost/smart_ptr/detail/sp_counted_base.hpp>
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
-#include <boost/checked_delete.hpp>
+#include <boost/core/checked_delete.hpp>
#include <boost/core/addressof.hpp>
#include <boost/config.hpp>
diff --git a/boost/smart_ptr/detail/sp_thread_pause.hpp b/boost/smart_ptr/detail/sp_thread_pause.hpp
index 2cddd90b01..a4701412b3 100644
--- a/boost/smart_ptr/detail/sp_thread_pause.hpp
+++ b/boost/smart_ptr/detail/sp_thread_pause.hpp
@@ -1,51 +1,23 @@
#ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_PAUSE_HPP_INCLUDED
#define BOOST_SMART_PTR_DETAIL_SP_THREAD_PAUSE_HPP_INCLUDED
-// MS compatible compilers support #pragma once
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
-#endif
-
-// boost/smart_ptr/detail/sp_thread_pause.hpp
-//
-// inline void bost::detail::sp_thread_pause();
-//
-// Emits a "pause" instruction.
-//
-// Copyright 2008, 2020 Peter Dimov
-// Distributed under the Boost Software License, Version 1.0
+// Copyright 2023 Peter Dimov
+// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
-#if defined(_MSC_VER) && _MSC_VER >= 1310 && ( defined(_M_IX86) || defined(_M_X64) ) && !defined(__c2__)
-
-extern "C" void _mm_pause();
-
-#define BOOST_SP_PAUSE _mm_pause();
-
-#elif defined(__GNUC__) && ( defined(__i386__) || defined(__x86_64__) )
+#include <boost/core/yield_primitives.hpp>
+#include <boost/config/header_deprecated.hpp>
-#define BOOST_SP_PAUSE __asm__ __volatile__( "rep; nop" : : : "memory" );
-
-#else
-
-#define BOOST_SP_PAUSE
-
-#endif
+BOOST_HEADER_DEPRECATED( "<boost/core/yield_primitives.hpp>" )
namespace boost
{
namespace detail
{
-inline void sp_thread_pause()
-{
- BOOST_SP_PAUSE
-}
+using boost::core::sp_thread_pause;
} // namespace detail
} // namespace boost
-#undef BOOST_SP_PAUSE
-
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_PAUSE_HPP_INCLUDED
diff --git a/boost/smart_ptr/detail/sp_thread_sleep.hpp b/boost/smart_ptr/detail/sp_thread_sleep.hpp
index ff1d168808..8242f51fa9 100644
--- a/boost/smart_ptr/detail/sp_thread_sleep.hpp
+++ b/boost/smart_ptr/detail/sp_thread_sleep.hpp
@@ -1,104 +1,23 @@
#ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_SLEEP_HPP_INCLUDED
#define BOOST_SMART_PTR_DETAIL_SP_THREAD_SLEEP_HPP_INCLUDED
-// MS compatible compilers support #pragma once
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
-#endif
-
-// boost/smart_ptr/detail/sp_thread_sleep.hpp
-//
-// inline void bost::detail::sp_thread_sleep();
-//
-// Cease execution for a while to yield to other threads,
-// as if by calling nanosleep() with an appropriate interval.
-//
-// Copyright 2008, 2020 Peter Dimov
-// Distributed under the Boost Software License, Version 1.0
+// Copyright 2023 Peter Dimov
+// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
-#include <boost/config.hpp>
-#include <boost/config/pragma_message.hpp>
-
-#if defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
+#include <boost/core/yield_primitives.hpp>
+#include <boost/config/header_deprecated.hpp>
-#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
- BOOST_PRAGMA_MESSAGE("Using Sleep(1) in sp_thread_sleep")
-#endif
-
-#include <boost/smart_ptr/detail/sp_win32_sleep.hpp>
+BOOST_HEADER_DEPRECATED( "<boost/core/yield_primitives.hpp>" )
namespace boost
{
-
namespace detail
{
-inline void sp_thread_sleep()
-{
- Sleep( 1 );
-}
+using boost::core::sp_thread_sleep;
} // namespace detail
-
} // namespace boost
-#elif defined(BOOST_HAS_NANOSLEEP)
-
-#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
- BOOST_PRAGMA_MESSAGE("Using nanosleep() in sp_thread_sleep")
-#endif
-
-#include <time.h>
-
-namespace boost
-{
-
-namespace detail
-{
-
-inline void sp_thread_sleep()
-{
- // g++ -Wextra warns on {} or {0}
- struct timespec rqtp = { 0, 0 };
-
- // POSIX says that timespec has tv_sec and tv_nsec
- // But it doesn't guarantee order or placement
-
- rqtp.tv_sec = 0;
- rqtp.tv_nsec = 1000;
-
- nanosleep( &rqtp, 0 );
-}
-
-} // namespace detail
-
-} // namespace boost
-
-#else
-
-#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
- BOOST_PRAGMA_MESSAGE("Using sp_thread_yield() in sp_thread_sleep")
-#endif
-
-#include <boost/smart_ptr/detail/sp_thread_yield.hpp>
-
-namespace boost
-{
-
-namespace detail
-{
-
-inline void sp_thread_sleep()
-{
- sp_thread_yield();
-}
-
-} // namespace detail
-
-} // namespace boost
-
-#endif
-
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_SLEEP_HPP_INCLUDED
diff --git a/boost/smart_ptr/detail/sp_thread_yield.hpp b/boost/smart_ptr/detail/sp_thread_yield.hpp
index 9a221cc274..741d762265 100644
--- a/boost/smart_ptr/detail/sp_thread_yield.hpp
+++ b/boost/smart_ptr/detail/sp_thread_yield.hpp
@@ -1,100 +1,23 @@
#ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_YIELD_HPP_INCLUDED
#define BOOST_SMART_PTR_DETAIL_SP_THREAD_YIELD_HPP_INCLUDED
-// MS compatible compilers support #pragma once
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
-#endif
-
-// boost/smart_ptr/detail/sp_thread_yield.hpp
-//
-// inline void bost::detail::sp_thread_yield();
-//
-// Gives up the remainder of the time slice,
-// as if by calling sched_yield().
-//
-// Copyright 2008, 2020 Peter Dimov
-// Distributed under the Boost Software License, Version 1.0
+// Copyright 2023 Peter Dimov
+// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
-#include <boost/config.hpp>
-#include <boost/config/pragma_message.hpp>
-
-#if defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
-
-#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
- BOOST_PRAGMA_MESSAGE("Using Sleep(0) in sp_thread_yield")
-#endif
-
-#include <boost/smart_ptr/detail/sp_win32_sleep.hpp>
-
-namespace boost
-{
-
-namespace detail
-{
-
-inline void sp_thread_yield()
-{
- Sleep( 0 );
-}
-
-} // namespace detail
-
-} // namespace boost
-
-#elif defined(BOOST_HAS_SCHED_YIELD)
-
-#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
- BOOST_PRAGMA_MESSAGE("Using sched_yield() in sp_thread_yield")
-#endif
+#include <boost/core/yield_primitives.hpp>
+#include <boost/config/header_deprecated.hpp>
-#ifndef _AIX
-# include <sched.h>
-#else
- // AIX's sched.h defines ::var which sometimes conflicts with Lambda's var
- extern "C" int sched_yield(void);
-#endif
+BOOST_HEADER_DEPRECATED( "<boost/core/yield_primitives.hpp>" )
namespace boost
{
-
namespace detail
{
-inline void sp_thread_yield()
-{
- sched_yield();
-}
+using boost::core::sp_thread_yield;
} // namespace detail
-
} // namespace boost
-#else
-
-#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
- BOOST_PRAGMA_MESSAGE("Using sp_thread_pause() in sp_thread_yield")
-#endif
-
-#include <boost/smart_ptr/detail/sp_thread_pause.hpp>
-
-namespace boost
-{
-
-namespace detail
-{
-
-inline void sp_thread_yield()
-{
- sp_thread_pause();
-}
-
-} // namespace detail
-
-} // namespace boost
-
-#endif
-
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_THREAD_YIELD_HPP_INCLUDED
diff --git a/boost/smart_ptr/detail/sp_win32_sleep.hpp b/boost/smart_ptr/detail/sp_win32_sleep.hpp
deleted file mode 100644
index 139a569fb7..0000000000
--- a/boost/smart_ptr/detail/sp_win32_sleep.hpp
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef BOOST_SMART_PTR_DETAIL_SP_WIN32_SLEEP_HPP_INCLUDED
-#define BOOST_SMART_PTR_DETAIL_SP_WIN32_SLEEP_HPP_INCLUDED
-
-// MS compatible compilers support #pragma once
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
-#endif
-
-// boost/smart_ptr/detail/sp_win32_sleep.hpp
-//
-// Declares the Win32 Sleep() function.
-//
-// Copyright 2008, 2020 Peter Dimov
-// Distributed under the Boost Software License, Version 1.0
-// https://www.boost.org/LICENSE_1_0.txt
-
-#if defined( BOOST_USE_WINDOWS_H )
-# include <windows.h>
-#endif
-
-namespace boost
-{
-namespace detail
-{
-
-#if !defined( BOOST_USE_WINDOWS_H )
-
-#if defined(__clang__) && defined(__x86_64__)
-// clang x64 warns that __stdcall is ignored
-# define BOOST_SP_STDCALL
-#else
-# define BOOST_SP_STDCALL __stdcall
-#endif
-
-#if defined(__LP64__) // Cygwin 64
- extern "C" __declspec(dllimport) void BOOST_SP_STDCALL Sleep( unsigned int ms );
-#else
- extern "C" __declspec(dllimport) void BOOST_SP_STDCALL Sleep( unsigned long ms );
-#endif
-
-#undef BOOST_SP_STDCALL
-
-#endif // !defined( BOOST_USE_WINDOWS_H )
-
-} // namespace detail
-} // namespace boost
-
-#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_WIN32_SLEEP_HPP_INCLUDED
diff --git a/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp b/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp
index 8cd71791e4..d87b8441fc 100644
--- a/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp
+++ b/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp
@@ -30,7 +30,16 @@ class spinlock
{
public:
- unsigned char v_;
+ // `bool` alignment is required for Apple PPC32
+ // https://github.com/boostorg/smart_ptr/issues/105
+ // https://github.com/PurpleI2P/i2pd/issues/1726
+ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107590
+
+ union
+ {
+ unsigned char v_;
+ bool align_;
+ };
public:
@@ -80,6 +89,6 @@ public:
} // namespace detail
} // namespace boost
-#define BOOST_DETAIL_SPINLOCK_INIT {0}
+#define BOOST_DETAIL_SPINLOCK_INIT {{0}}
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_GCC_ATOMIC_HPP_INCLUDED
diff --git a/boost/smart_ptr/detail/yield_k.hpp b/boost/smart_ptr/detail/yield_k.hpp
index d9a1b46ab6..7f6c645919 100644
--- a/boost/smart_ptr/detail/yield_k.hpp
+++ b/boost/smart_ptr/detail/yield_k.hpp
@@ -19,9 +19,7 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
-#include <boost/smart_ptr/detail/sp_thread_pause.hpp>
-#include <boost/smart_ptr/detail/sp_thread_sleep.hpp>
-#include <boost/config.hpp>
+#include <boost/core/yield_primitives.hpp>
namespace boost
{
@@ -34,13 +32,13 @@ inline void yield( unsigned k )
// Experiments on Windows and Fedora 32 show that a single pause,
// followed by an immediate sp_thread_sleep(), is best.
- if( k == 0 )
+ if( k & 1 )
{
- sp_thread_pause();
+ boost::core::sp_thread_sleep();
}
else
{
- sp_thread_sleep();
+ boost::core::sp_thread_pause();
}
}
diff --git a/boost/smart_ptr/enable_shared_from.hpp b/boost/smart_ptr/enable_shared_from.hpp
index be88b30aa7..68fb8e42a2 100644
--- a/boost/smart_ptr/enable_shared_from.hpp
+++ b/boost/smart_ptr/enable_shared_from.hpp
@@ -11,6 +11,7 @@
//
// See http://www.boost.org/libs/smart_ptr/ for documentation.
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
#include <boost/smart_ptr/enable_shared_from_this.hpp>
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
diff --git a/boost/smart_ptr/enable_shared_from_this.hpp b/boost/smart_ptr/enable_shared_from_this.hpp
index fc4de0b571..b4ea23cf8a 100644
--- a/boost/smart_ptr/enable_shared_from_this.hpp
+++ b/boost/smart_ptr/enable_shared_from_this.hpp
@@ -13,6 +13,7 @@
// See http://www.boost.org/libs/smart_ptr/ for documentation.
//
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
#include <boost/smart_ptr/weak_ptr.hpp>
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
diff --git a/boost/smart_ptr/intrusive_ptr.hpp b/boost/smart_ptr/intrusive_ptr.hpp
index ef682df96c..733be391fb 100644
--- a/boost/smart_ptr/intrusive_ptr.hpp
+++ b/boost/smart_ptr/intrusive_ptr.hpp
@@ -13,6 +13,8 @@
// See http://www.boost.org/libs/smart_ptr/ for documentation.
//
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
+
#include <boost/config.hpp>
#include <boost/assert.hpp>
@@ -245,7 +247,7 @@ template<class T, class U> inline bool operator!=(T * a, intrusive_ptr<U> const
return a != b.get();
}
-#if __GNUC__ == 2 && __GNUC_MINOR__ <= 96
+#if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ <= 96
// Resolve the ambiguity between our op!= and the one in rel_ops
diff --git a/boost/smart_ptr/local_shared_ptr.hpp b/boost/smart_ptr/local_shared_ptr.hpp
index 86c94d5c2c..19051dfd6f 100644
--- a/boost/smart_ptr/local_shared_ptr.hpp
+++ b/boost/smart_ptr/local_shared_ptr.hpp
@@ -11,6 +11,7 @@
//
// See http://www.boost.org/libs/smart_ptr/ for documentation.
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
#include <boost/smart_ptr/shared_ptr.hpp>
namespace boost
diff --git a/boost/smart_ptr/make_local_shared.hpp b/boost/smart_ptr/make_local_shared.hpp
index 23114fea26..2ad55a7df9 100644
--- a/boost/smart_ptr/make_local_shared.hpp
+++ b/boost/smart_ptr/make_local_shared.hpp
@@ -11,6 +11,7 @@
//
// See http://www.boost.org/libs/smart_ptr/ for documentation.
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
#include <boost/smart_ptr/make_local_shared_object.hpp>
#include <boost/smart_ptr/make_local_shared_array.hpp>
diff --git a/boost/smart_ptr/make_local_shared_array.hpp b/boost/smart_ptr/make_local_shared_array.hpp
index ba88c737f3..6caf78abcd 100644
--- a/boost/smart_ptr/make_local_shared_array.hpp
+++ b/boost/smart_ptr/make_local_shared_array.hpp
@@ -9,6 +9,7 @@ Distributed under the Boost Software License, Version 1.0.
#ifndef BOOST_SMART_PTR_MAKE_LOCAL_SHARED_ARRAY_HPP
#define BOOST_SMART_PTR_MAKE_LOCAL_SHARED_ARRAY_HPP
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
#include <boost/core/default_allocator.hpp>
#include <boost/smart_ptr/allocate_local_shared_array.hpp>
diff --git a/boost/smart_ptr/make_local_shared_object.hpp b/boost/smart_ptr/make_local_shared_object.hpp
index 4545c5e0e5..2226688515 100644
--- a/boost/smart_ptr/make_local_shared_object.hpp
+++ b/boost/smart_ptr/make_local_shared_object.hpp
@@ -11,6 +11,7 @@
//
// See http://www.boost.org/libs/smart_ptr/ for documentation.
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
#include <boost/smart_ptr/local_shared_ptr.hpp>
#include <boost/smart_ptr/make_shared.hpp>
#include <boost/type_traits/remove_const.hpp>
diff --git a/boost/smart_ptr/make_shared.hpp b/boost/smart_ptr/make_shared.hpp
index dd9191c61d..fd2261bc5a 100644
--- a/boost/smart_ptr/make_shared.hpp
+++ b/boost/smart_ptr/make_shared.hpp
@@ -11,6 +11,7 @@
//
// See http://www.boost.org/libs/smart_ptr/ for documentation.
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
#include <boost/smart_ptr/make_shared_object.hpp>
#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined( BOOST_NO_SFINAE )
diff --git a/boost/smart_ptr/make_shared_array.hpp b/boost/smart_ptr/make_shared_array.hpp
index 785eb875fc..10dfdaa1b8 100644
--- a/boost/smart_ptr/make_shared_array.hpp
+++ b/boost/smart_ptr/make_shared_array.hpp
@@ -8,6 +8,7 @@ Distributed under the Boost Software License, Version 1.0.
#ifndef BOOST_SMART_PTR_MAKE_SHARED_ARRAY_HPP
#define BOOST_SMART_PTR_MAKE_SHARED_ARRAY_HPP
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
#include <boost/core/default_allocator.hpp>
#include <boost/smart_ptr/allocate_shared_array.hpp>
diff --git a/boost/smart_ptr/make_shared_object.hpp b/boost/smart_ptr/make_shared_object.hpp
index d726ec3054..12a7bac109 100644
--- a/boost/smart_ptr/make_shared_object.hpp
+++ b/boost/smart_ptr/make_shared_object.hpp
@@ -11,6 +11,7 @@
//
// See http://www.boost.org/libs/smart_ptr/ for documentation.
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
#include <boost/config.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
diff --git a/boost/smart_ptr/make_unique.hpp b/boost/smart_ptr/make_unique.hpp
index 1834007872..c2c6ef30e4 100644
--- a/boost/smart_ptr/make_unique.hpp
+++ b/boost/smart_ptr/make_unique.hpp
@@ -8,6 +8,7 @@ Distributed under the Boost Software License, Version 1.0.
#ifndef BOOST_SMART_PTR_MAKE_UNIQUE_HPP
#define BOOST_SMART_PTR_MAKE_UNIQUE_HPP
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
#include <boost/type_traits/enable_if.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_unbounded_array.hpp>
diff --git a/boost/smart_ptr/scoped_array.hpp b/boost/smart_ptr/scoped_array.hpp
index d56112cfa0..d3c250d075 100644
--- a/boost/smart_ptr/scoped_array.hpp
+++ b/boost/smart_ptr/scoped_array.hpp
@@ -10,9 +10,10 @@
//
// See http://www.boost.org/libs/smart_ptr/ for documentation.
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
#include <boost/config.hpp>
#include <boost/assert.hpp>
-#include <boost/checked_delete.hpp>
+#include <boost/core/checked_delete.hpp>
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
diff --git a/boost/smart_ptr/scoped_ptr.hpp b/boost/smart_ptr/scoped_ptr.hpp
index 9cf9566e01..da8df191be 100644
--- a/boost/smart_ptr/scoped_ptr.hpp
+++ b/boost/smart_ptr/scoped_ptr.hpp
@@ -10,9 +10,10 @@
//
// See http://www.boost.org/libs/smart_ptr/ for documentation.
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
#include <boost/config.hpp>
#include <boost/assert.hpp>
-#include <boost/checked_delete.hpp>
+#include <boost/core/checked_delete.hpp>
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
#include <boost/smart_ptr/detail/sp_disable_deprecated.hpp>
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
diff --git a/boost/smart_ptr/shared_array.hpp b/boost/smart_ptr/shared_array.hpp
index c91b71f0f8..05933e04c3 100644
--- a/boost/smart_ptr/shared_array.hpp
+++ b/boost/smart_ptr/shared_array.hpp
@@ -14,12 +14,14 @@
// See http://www.boost.org/libs/smart_ptr/ for documentation.
//
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
+
#include <boost/config.hpp> // for broken compiler workarounds
#include <memory> // TR1 cyclic inclusion fix
#include <boost/assert.hpp>
-#include <boost/checked_delete.hpp>
+#include <boost/core/checked_delete.hpp>
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/smart_ptr/detail/shared_count.hpp>
diff --git a/boost/smart_ptr/shared_ptr.hpp b/boost/smart_ptr/shared_ptr.hpp
index 386ac099c6..e5993aa7e3 100644
--- a/boost/smart_ptr/shared_ptr.hpp
+++ b/boost/smart_ptr/shared_ptr.hpp
@@ -14,12 +14,13 @@
// See http://www.boost.org/libs/smart_ptr/ for documentation.
//
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
#include <boost/smart_ptr/detail/shared_count.hpp>
#include <boost/smart_ptr/detail/sp_convertible.hpp>
#include <boost/smart_ptr/detail/sp_nullptr_t.hpp>
#include <boost/smart_ptr/detail/sp_disable_deprecated.hpp>
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
-#include <boost/checked_delete.hpp>
+#include <boost/core/checked_delete.hpp>
#include <boost/throw_exception.hpp>
#include <boost/assert.hpp>
#include <boost/config.hpp>
@@ -667,9 +668,8 @@ public:
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
- shared_ptr( shared_ptr && r ) BOOST_SP_NOEXCEPT : px( r.px ), pn()
+ shared_ptr( shared_ptr && r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( static_cast< boost::detail::shared_count && >( r.pn ) )
{
- pn.swap( r.pn );
r.px = 0;
}
@@ -683,11 +683,9 @@ public:
shared_ptr( shared_ptr<Y> && r )
#endif
- BOOST_SP_NOEXCEPT : px( r.px ), pn()
+ BOOST_SP_NOEXCEPT : px( r.px ), pn( static_cast< boost::detail::shared_count && >( r.pn ) )
{
boost::detail::sp_assert_convertible< Y, T >();
-
- pn.swap( r.pn );
r.px = 0;
}
diff --git a/boost/smart_ptr/weak_ptr.hpp b/boost/smart_ptr/weak_ptr.hpp
index 16eea6777c..2022bce8d9 100644
--- a/boost/smart_ptr/weak_ptr.hpp
+++ b/boost/smart_ptr/weak_ptr.hpp
@@ -13,6 +13,7 @@
// See http://www.boost.org/libs/smart_ptr/ for documentation.
//
+#include <boost/smart_ptr/detail/requires_cxx11.hpp>
#include <boost/smart_ptr/detail/shared_count.hpp>
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/smart_ptr/detail/sp_noexcept.hpp>