diff --git a/include/boost/serialization/base_object.hpp b/include/boost/serialization/base_object.hpp
index 0c6b51f0..a8d4d350 100644
--- a/include/boost/serialization/base_object.hpp
+++ b/include/boost/serialization/base_object.hpp
@@ -54,11 +54,12 @@ namespace detail {
}
};
static void invoke(){
- mpl::eval_if<
+ typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
BOOST_DEDUCED_TYPENAME type_info_implementation::type::is_polymorphic,
mpl::identity >,
mpl::identity
- >::type::invoke();
+ >::type typex;
+ typex::invoke();
}
};
diff --git a/include/boost/smart_cast.hpp b/include/boost/smart_cast.hpp
index 30ac2482..9e3b760c 100644
--- a/include/boost/smart_cast.hpp
+++ b/include/boost/smart_cast.hpp
@@ -82,7 +82,7 @@ namespace smart_cast_impl {
static T cast(U & u){
// if we're in debug mode
#if ! defined(NDEBUG) \
- || defined(__BORLANDC__) && (__BORLANDC__ <= 0x551) \
+ || defined(__BORLANDC__) && (__BORLANDC__ <= 0x564) \
|| defined(__MWERKS__)
// do a checked dynamic cast
return cross::cast(u);
@@ -107,6 +107,7 @@ namespace smart_cast_impl {
mpl::identity,
mpl::identity
>::type typex;
+ // typex works around gcc 2.95 issue
return typex::cast(u);
#endif
}
@@ -120,11 +121,20 @@ namespace smart_cast_impl {
};
template
static T cast(U & u){
- return mpl::eval_if<
- boost::is_polymorphic,
- mpl::identity,
- mpl::identity
- >::type::cast(u);
+ #if defined(__BORLANDC__)
+ return mpl::eval_if<
+ boost::is_polymorphic,
+ mpl::identity,
+ mpl::identity
+ >::type::cast(u);
+ #else
+ typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ boost::is_polymorphic,
+ mpl::identity,
+ mpl::identity
+ >::type typex;
+ return typex::cast(u);
+ #endif
}
};
@@ -154,7 +164,7 @@ namespace smart_cast_impl {
template
static T cast(U * u){
// if we're in debug mode
- #if ! defined(NDEBUG) || defined(__BORLANDC__) && (__BORLANDC__ <= 0x551)
+ #if ! defined(NDEBUG) || defined(__BORLANDC__) && (__BORLANDC__ <= 0x564)
// do a checked dynamic cast
return cross::cast(u);
#else
@@ -193,11 +203,20 @@ namespace smart_cast_impl {
template
static T cast(U * u){
- return mpl::eval_if<
- boost::is_polymorphic,
- mpl::identity,
- mpl::identity
- >::type::cast(u);
+ #if defined(__BORLANDC__)
+ return BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ boost::is_polymorphic,
+ mpl::identity,
+ mpl::identity
+ >::type::cast(u);
+ #else
+ typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ boost::is_polymorphic,
+ mpl::identity,
+ mpl::identity
+ >::type typex;
+ return typex::cast(u);
+ #endif
}
};
diff --git a/include/boost/state_saver.hpp b/include/boost/state_saver.hpp
index 4fd3a11a..d894047c 100644
--- a/include/boost/state_saver.hpp
+++ b/include/boost/state_saver.hpp
@@ -77,11 +77,12 @@ public:
{}
~state_saver() {
- mpl::eval_if<
- ::boost::has_nothrow_copy,
+ typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ has_nothrow_copy,
mpl::identity,
mpl::identity
- >::type::invoke(previous_ref, previous_value);
+ >::type typex;
+ typex::invoke(previous_ref, previous_value);
}
}; // state_saver<>