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/utility/value_init.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/utility/value_init.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/utility/value_init.hpp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/3rdParty/Boost/src/boost/utility/value_init.hpp b/3rdParty/Boost/src/boost/utility/value_init.hpp index 5de9585..9d8de70 100644 --- a/3rdParty/Boost/src/boost/utility/value_init.hpp +++ b/3rdParty/Boost/src/boost/utility/value_init.hpp @@ -33,7 +33,6 @@ #ifdef BOOST_MSVC #pragma warning(push) -#if _MSC_VER >= 1310 // It is safe to ignore the following warning from MSVC 7.1 or higher: // "warning C4351: new behavior: elements of array will be default initialized" #pragma warning(disable: 4351) @@ -41,7 +40,6 @@ // a const type: "warning C4512: assignment operator could not be generated". #pragma warning(disable: 4512) #endif -#endif #ifdef BOOST_NO_COMPLETE_VALUE_INITIALIZATION // Implementation detail: The macro BOOST_DETAIL_VALUE_INIT_WORKAROUND_SUGGESTED @@ -73,12 +71,14 @@ class initialized #endif remove_const<T>::type data; + BOOST_GPU_ENABLED wrapper() : data() { } + BOOST_GPU_ENABLED wrapper(T const & arg) : data(arg) @@ -92,6 +92,7 @@ class initialized #endif aligned_storage<sizeof(wrapper), alignment_of<wrapper>::value>::type x; + BOOST_GPU_ENABLED wrapper * wrapper_address() const { return static_cast<wrapper *>( static_cast<void*>(&x)); @@ -99,6 +100,7 @@ class initialized public : + BOOST_GPU_ENABLED initialized() { #if BOOST_DETAIL_VALUE_INIT_WORKAROUND @@ -107,16 +109,19 @@ class initialized new (wrapper_address()) wrapper(); } + BOOST_GPU_ENABLED initialized(initialized const & arg) { new (wrapper_address()) wrapper( static_cast<wrapper const &>(*(arg.wrapper_address()))); } + BOOST_GPU_ENABLED explicit initialized(T const & arg) { new (wrapper_address()) wrapper(arg); } + BOOST_GPU_ENABLED initialized & operator=(initialized const & arg) { // Assignment is only allowed when T is non-const. @@ -125,31 +130,37 @@ class initialized return *this; } + BOOST_GPU_ENABLED ~initialized() { wrapper_address()->wrapper::~wrapper(); } + BOOST_GPU_ENABLED T const & data() const { return wrapper_address()->data; } + BOOST_GPU_ENABLED T& data() { return wrapper_address()->data; } + BOOST_GPU_ENABLED void swap(initialized & arg) { ::boost::swap( this->data(), arg.data() ); } + BOOST_GPU_ENABLED operator T const &() const { return wrapper_address()->data; } + BOOST_GPU_ENABLED operator T&() { return wrapper_address()->data; @@ -158,18 +169,21 @@ class initialized } ; template<class T> +BOOST_GPU_ENABLED T const& get ( initialized<T> const& x ) { return x.data() ; } template<class T> +BOOST_GPU_ENABLED T& get ( initialized<T>& x ) { return x.data() ; } template<class T> +BOOST_GPU_ENABLED void swap ( initialized<T> & lhs, initialized<T> & rhs ) { lhs.swap(rhs) ; @@ -185,31 +199,37 @@ class value_initialized public : + BOOST_GPU_ENABLED value_initialized() : m_data() { } + BOOST_GPU_ENABLED T const & data() const { return m_data.data(); } + BOOST_GPU_ENABLED T& data() { return m_data.data(); } + BOOST_GPU_ENABLED void swap(value_initialized & arg) { m_data.swap(arg.m_data); } + BOOST_GPU_ENABLED operator T const &() const { return m_data; } + BOOST_GPU_ENABLED operator T&() { return m_data; @@ -218,18 +238,21 @@ class value_initialized template<class T> +BOOST_GPU_ENABLED T const& get ( value_initialized<T> const& x ) { return x.data() ; } template<class T> +BOOST_GPU_ENABLED T& get ( value_initialized<T>& x ) { return x.data() ; } template<class T> +BOOST_GPU_ENABLED void swap ( value_initialized<T> & lhs, value_initialized<T> & rhs ) { lhs.swap(rhs) ; @@ -240,7 +263,7 @@ class initialized_value_t { public : - template <class T> operator T() const + template <class T> BOOST_GPU_ENABLED operator T() const { return initialized<T>().data(); } |