summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2014-10-19 20:22:58 (GMT)
committerTobias Markmann <tm@ayena.de>2014-10-20 13:49:33 (GMT)
commit6b22dfcf59474dd016a0355a3102a1dd3692d92c (patch)
tree2b1fd33be433a91e81fee84fdc2bf1b52575d934 /3rdParty/Boost/src/boost/serialization/smart_cast.hpp
parent38b0cb785fea8eae5e48fae56440695fdfd10ee1 (diff)
downloadswift-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/serialization/smart_cast.hpp')
-rw-r--r--3rdParty/Boost/src/boost/serialization/smart_cast.hpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/3rdParty/Boost/src/boost/serialization/smart_cast.hpp b/3rdParty/Boost/src/boost/serialization/smart_cast.hpp
index c240a55..02edb4b 100644
--- a/3rdParty/Boost/src/boost/serialization/smart_cast.hpp
+++ b/3rdParty/Boost/src/boost/serialization/smart_cast.hpp
@@ -1,11 +1,11 @@
#ifndef BOOST_SERIALIZATION_SMART_CAST_HPP
#define BOOST_SERIALIZATION_SMART_CAST_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// smart_cast.hpp:
@@ -53,12 +53,14 @@
#include <boost/mpl/if.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mpl/identity.hpp>
+#include <boost/serialization/throw_exception.hpp>
+
namespace boost {
namespace serialization {
namespace smart_cast_impl {
template<class T>
struct reference {
@@ -90,21 +92,21 @@ namespace smart_cast_impl {
#else
// borland 5.51 chokes here so we can't use it
// note: if remove_reference isn't function for these types
// cross casting will be selected this will work but will
// not be the most efficient method. This will conflict with
// the original smart_cast motivation.
- typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
- BOOST_DEDUCED_TYPENAME mpl::and_<
+ typedef typename mpl::eval_if<
+ typename mpl::and_<
mpl::not_<is_base_and_derived<
- BOOST_DEDUCED_TYPENAME remove_reference< T >::type,
+ typename remove_reference< T >::type,
U
> >,
mpl::not_<is_base_and_derived<
U,
- BOOST_DEDUCED_TYPENAME remove_reference< T >::type
+ typename remove_reference< T >::type
> >
>,
// borland chokes w/o full qualification here
mpl::identity<cross>,
mpl::identity<linear>
>::type typex;
@@ -126,13 +128,13 @@ namespace smart_cast_impl {
return mpl::eval_if<
boost::is_polymorphic<U>,
mpl::identity<polymorphic>,
mpl::identity<non_polymorphic>
>::type::cast(u);
#else
- typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ typedef typename mpl::eval_if<
boost::is_polymorphic<U>,
mpl::identity<polymorphic>,
mpl::identity<non_polymorphic>
>::type typex;
return typex::cast(u);
#endif
@@ -156,40 +158,40 @@ namespace smart_cast_impl {
struct cross {
template<class U>
static T cast(U * u){
T tmp = dynamic_cast< T >(u);
#ifndef NDEBUG
- if ( tmp == 0 ) throw std::bad_cast();
+ if ( tmp == 0 ) throw_exception(std::bad_cast());
#endif
return tmp;
}
};
template<class U>
static T cast(U * u){
// if we're in debug mode
- #if ! defined(NDEBUG) || defined(__BORLANDC__) && (__BORLANDC__ <= 0x560)
+ #if 0 //! defined(NDEBUG) || defined(__BORLANDC__) && (__BORLANDC__ <= 0x560)
// do a checked dynamic cast
return cross::cast(u);
#else
// borland 5.51 chokes here so we can't use it
// note: if remove_pointer isn't function for these types
// cross casting will be selected this will work but will
// not be the most efficient method. This will conflict with
// the original smart_cast motivation.
typedef
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
- BOOST_DEDUCED_TYPENAME mpl::and_<
+ typename mpl::eval_if<
+ typename mpl::and_<
mpl::not_<is_base_and_derived<
- BOOST_DEDUCED_TYPENAME remove_pointer< T >::type,
+ typename remove_pointer< T >::type,
U
> >,
mpl::not_<is_base_and_derived<
U,
- BOOST_DEDUCED_TYPENAME remove_pointer< T >::type
+ typename remove_pointer< T >::type
> >
>,
// borland chokes w/o full qualification here
mpl::identity<cross>,
mpl::identity<linear>
>::type typex;
@@ -198,13 +200,13 @@ namespace smart_cast_impl {
}
#else
template<class U>
static T cast(U * u){
T tmp = dynamic_cast< T >(u);
#ifndef NDEBUG
- if ( tmp == 0 ) throw std::bad_cast();
+ if ( tmp == 0 ) throw_exception(std::bad_cast());
#endif
return tmp;
}
#endif
};
@@ -221,13 +223,13 @@ namespace smart_cast_impl {
return mpl::eval_if<
boost::is_polymorphic<U>,
mpl::identity<polymorphic>,
mpl::identity<non_polymorphic>
>::type::cast(u);
#else
- typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ typedef typename mpl::eval_if<
boost::is_polymorphic<U>,
mpl::identity<polymorphic>,
mpl::identity<non_polymorphic>
>::type typex;
return typex::cast(u);
#endif
@@ -262,25 +264,25 @@ namespace smart_cast_impl {
// smart_cast<Target &, Source &>(s)
// note that it will fail with
// smart_cast<Target &>(s)
template<class T, class U>
T smart_cast(U u) {
typedef
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
- BOOST_DEDUCED_TYPENAME mpl::or_<
+ typename mpl::eval_if<
+ typename mpl::or_<
boost::is_same<void *, U>,
boost::is_same<void *, T>,
boost::is_same<const void *, U>,
boost::is_same<const void *, T>
>,
mpl::identity<smart_cast_impl::void_pointer< T > >,
// else
- BOOST_DEDUCED_TYPENAME mpl::eval_if<boost::is_pointer<U>,
+ typename mpl::eval_if<boost::is_pointer<U>,
mpl::identity<smart_cast_impl::pointer< T > >,
// else
- BOOST_DEDUCED_TYPENAME mpl::eval_if<boost::is_reference<U>,
+ typename mpl::eval_if<boost::is_reference<U>,
mpl::identity<smart_cast_impl::reference< T > >,
// else
mpl::identity<smart_cast_impl::error< T >
>
>
>