diff options
author | Tobias Markmann <tm@ayena.de> | 2014-10-19 20:22:58 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2014-10-20 13:49:33 (GMT) |
commit | 6b22dfcf59474dd016a0355a3102a1dd3692d92c (patch) | |
tree | 2b1fd33be433a91e81fee84fdc2bf1b52575d934 /3rdParty/Boost/src/boost/smart_ptr/intrusive_ptr.hpp | |
parent | 38b0cb785fea8eae5e48fae56440695fdfd10ee1 (diff) | |
download | swift-6b22dfcf59474dd016a0355a3102a1dd3692d92c.zip swift-6b22dfcf59474dd016a0355a3102a1dd3692d92c.tar.bz2 |
Update Boost in 3rdParty to version 1.56.0.
This updates Boost in our 3rdParty directory to version 1.56.0.
Updated our update.sh script to stop on error.
Changed error reporting in SwiftTools/CrashReporter.cpp to SWIFT_LOG due to
missing include of <iostream> with newer Boost.
Change-Id: I4b35c77de951333979a524097f35f5f83d325edc
Diffstat (limited to '3rdParty/Boost/src/boost/smart_ptr/intrusive_ptr.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/smart_ptr/intrusive_ptr.hpp | 51 |
1 files changed, 44 insertions, 7 deletions
diff --git a/3rdParty/Boost/src/boost/smart_ptr/intrusive_ptr.hpp b/3rdParty/Boost/src/boost/smart_ptr/intrusive_ptr.hpp index a575223..e5db609 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/intrusive_ptr.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/intrusive_ptr.hpp @@ -18,6 +18,7 @@ #include <boost/assert.hpp> #include <boost/detail/workaround.hpp> #include <boost/smart_ptr/detail/sp_convertible.hpp> +#include <boost/smart_ptr/detail/sp_nullptr_t.hpp> #include <boost/config/no_tr1/functional.hpp> // for std::less @@ -58,7 +59,7 @@ public: typedef T element_type; - intrusive_ptr(): px( 0 ) + intrusive_ptr() BOOST_NOEXCEPT : px( 0 ) { } @@ -108,14 +109,14 @@ public: // Move support -#if defined( BOOST_HAS_RVALUE_REFS ) +#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) - intrusive_ptr(intrusive_ptr && rhs): px( rhs.px ) + intrusive_ptr(intrusive_ptr && rhs) BOOST_NOEXCEPT : px( rhs.px ) { rhs.px = 0; } - intrusive_ptr & operator=(intrusive_ptr && rhs) + intrusive_ptr & operator=(intrusive_ptr && rhs) BOOST_NOEXCEPT { this_type( static_cast< intrusive_ptr && >( rhs ) ).swap(*this); return *this; @@ -135,7 +136,7 @@ public: return *this; } - void reset() + void reset() BOOST_NOEXCEPT { this_type().swap( *this ); } @@ -145,11 +146,23 @@ public: this_type( rhs ).swap( *this ); } - T * get() const + void reset( T * rhs, bool add_ref ) + { + this_type( rhs, add_ref ).swap( *this ); + } + + T * get() const BOOST_NOEXCEPT { return px; } + T * detach() BOOST_NOEXCEPT + { + T * ret = px; + px = 0; + return ret; + } + T & operator*() const { BOOST_ASSERT( px != 0 ); @@ -165,7 +178,7 @@ public: // implicit conversion to "bool" #include <boost/smart_ptr/detail/operator_bool.hpp> - void swap(intrusive_ptr & rhs) + void swap(intrusive_ptr & rhs) BOOST_NOEXCEPT { T * tmp = px; px = rhs.px; @@ -218,6 +231,30 @@ template<class T> inline bool operator!=(intrusive_ptr<T> const & a, intrusive_p #endif +#if !defined( BOOST_NO_CXX11_NULLPTR ) + +template<class T> inline bool operator==( intrusive_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT +{ + return p.get() == 0; +} + +template<class T> inline bool operator==( boost::detail::sp_nullptr_t, intrusive_ptr<T> const & p ) BOOST_NOEXCEPT +{ + return p.get() == 0; +} + +template<class T> inline bool operator!=( intrusive_ptr<T> const & p, boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT +{ + return p.get() != 0; +} + +template<class T> inline bool operator!=( boost::detail::sp_nullptr_t, intrusive_ptr<T> const & p ) BOOST_NOEXCEPT +{ + return p.get() != 0; +} + +#endif + template<class T> inline bool operator<(intrusive_ptr<T> const & a, intrusive_ptr<T> const & b) { return std::less<T *>()(a.get(), b.get()); |