diff options
Diffstat (limited to '3rdParty/Boost/src/boost/serialization/smart_cast.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/serialization/smart_cast.hpp | 38 |
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 @@ -2,7 +2,7 @@ #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 @@ -56,6 +56,8 @@ #include <boost/mpl/not.hpp> #include <boost/mpl/identity.hpp> +#include <boost/serialization/throw_exception.hpp> + namespace boost { namespace serialization { namespace smart_cast_impl { @@ -93,15 +95,15 @@ namespace smart_cast_impl { // 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 @@ -129,7 +131,7 @@ namespace smart_cast_impl { 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> @@ -159,7 +161,7 @@ namespace smart_cast_impl { 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; } @@ -168,7 +170,7 @@ namespace smart_cast_impl { 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 @@ -178,15 +180,15 @@ namespace smart_cast_impl { // 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 @@ -201,7 +203,7 @@ namespace smart_cast_impl { 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; } @@ -224,7 +226,7 @@ namespace smart_cast_impl { 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> @@ -265,8 +267,8 @@ namespace smart_cast_impl { 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>, @@ -274,10 +276,10 @@ T smart_cast(U u) { >, 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 > |