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/scoped_array.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/scoped_array.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/smart_ptr/scoped_array.hpp | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/3rdParty/Boost/src/boost/smart_ptr/scoped_array.hpp b/3rdParty/Boost/src/boost/smart_ptr/scoped_array.hpp index 483460f..e395e28 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/scoped_array.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/scoped_array.hpp @@ -11,9 +11,10 @@ // http://www.boost.org/libs/smart_ptr/scoped_array.htm // +#include <boost/config.hpp> #include <boost/assert.hpp> #include <boost/checked_delete.hpp> -#include <boost/config.hpp> // in case ptrdiff_t not in std +#include <boost/smart_ptr/detail/sp_nullptr_t.hpp> #include <boost/detail/workaround.hpp> @@ -53,7 +54,7 @@ public: typedef T element_type; - explicit scoped_array( T * p = 0 ) : px( p ) // never throws + explicit scoped_array( T * p = 0 ) BOOST_NOEXCEPT : px( p ) { #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) boost::sp_array_constructor_hook( px ); @@ -68,20 +69,20 @@ public: boost::checked_array_delete( px ); } - void reset(T * p = 0) // never throws + void reset(T * p = 0) // never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT) { BOOST_ASSERT( p == 0 || p != px ); // catch self-reset errors this_type(p).swap(*this); } - T & operator[](std::ptrdiff_t i) const // never throws + T & operator[](std::ptrdiff_t i) const // never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT) { BOOST_ASSERT( px != 0 ); BOOST_ASSERT( i >= 0 ); return px[i]; } - T * get() const // never throws + T * get() const BOOST_NOEXCEPT { return px; } @@ -89,7 +90,7 @@ public: // implicit conversion to "bool" #include <boost/smart_ptr/detail/operator_bool.hpp> - void swap(scoped_array & b) // never throws + void swap(scoped_array & b) BOOST_NOEXCEPT { T * tmp = b.px; b.px = px; @@ -97,7 +98,31 @@ public: } }; -template<class T> inline void swap(scoped_array<T> & a, scoped_array<T> & b) // never throws +#if !defined( BOOST_NO_CXX11_NULLPTR ) + +template<class T> inline bool operator==( scoped_array<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, scoped_array<T> const & p ) BOOST_NOEXCEPT +{ + return p.get() == 0; +} + +template<class T> inline bool operator!=( scoped_array<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, scoped_array<T> const & p ) BOOST_NOEXCEPT +{ + return p.get() != 0; +} + +#endif + +template<class T> inline void swap(scoped_array<T> & a, scoped_array<T> & b) BOOST_NOEXCEPT { a.swap(b); } |