Fix Borland problems constructor overload disabling.

Restore all interoperable_fail tests which got broken along the way


[SVN r853]
This commit is contained in:
Dave Abrahams
2003-01-13 20:28:27 +00:00
parent 05afa8467c
commit 9aece673d9

View File

@@ -18,16 +18,12 @@
#include "boost/type_traits/detail/bool_trait_def.hpp" #include "boost/type_traits/detail/bool_trait_def.hpp"
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1301) \ #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
|| BOOST_WORKAROUND(__GNUC__, <= 2 && __GNUC_MINOR__ <= 95) \ || BOOST_WORKAROUND(__GNUC__, <= 2 && __GNUC_MINOR__ <= 95) \
|| BOOST_WORKAROUND(__MWERKS__, <= 0x3000) || BOOST_WORKAROUND(__MWERKS__, <= 0x3000)
# define BOOST_NO_SFINAE // "Substitution Failure Is Not An Error not implemented" # define BOOST_NO_SFINAE // "Substitution Failure Is Not An Error not implemented"
#endif #endif
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
# define BOOST_NO_ENABLE_IF_CONSTRUCTORS // Can't parse the syntax needed for enable_if in constructors
#endif
#if BOOST_WORKAROUND(BOOST_MSVC, <=1200) #if BOOST_WORKAROUND(BOOST_MSVC, <=1200)
# define BOOST_ARG_DEP_TYPENAME # define BOOST_ARG_DEP_TYPENAME
#else #else
@@ -36,8 +32,8 @@
// CWPro7 never works, and unfortunately vc7.1 final beta sometimes fails // CWPro7 never works, and unfortunately vc7.1 final beta sometimes fails
#if BOOST_WORKAROUND(__MWERKS__, <=0x2407) \ #if BOOST_WORKAROUND(__MWERKS__, <=0x2407) \
|| BOOST_WORKAROUND(_MSC_FULL_VER, BOOST_TESTED_AT(13102292)) || BOOST_WORKAROUND(_MSC_FULL_VER, BOOST_TESTED_AT(13102292) && BOOST_MSVC > 1300)
# define BOOST_NO_IS_CONVERTIBLE // "is_convertible doesn't work" # define BOOST_NO_IS_CONVERTIBLE // "is_convertible doesn't always work"
#endif #endif
#if BOOST_WORKAROUND(__GNUC__, == 2 && __GNUC_MINOR__ == 95) \ #if BOOST_WORKAROUND(__GNUC__, == 2 && __GNUC_MINOR__ == 95) \
@@ -113,11 +109,12 @@ namespace boost
// //
template <typename A, typename B> template <typename A, typename B>
struct is_interoperable struct is_interoperable
#ifdef BOOST_NO_IS_CONVERTIBLE #if defined(BOOST_NO_IS_CONVERTIBLE) && !(BOOST_MSVC > 1300) // vc7.1 is_convertible works sometimes
: mpl::true_c : mpl::true_c
#else #else
: mpl::logical_or< is_convertible< A, B >, : mpl::logical_or<
is_convertible< B, A > > is_convertible< A, B >
, is_convertible< B, A > >
#endif #endif
{ {
}; };
@@ -217,19 +214,19 @@ namespace boost
// false positives for user/library defined iterator types. See comments // false positives for user/library defined iterator types. See comments
// on operator implementation for consequences. // on operator implementation for consequences.
// //
template<typename From, template<
typename To> typename From
, typename To>
struct enable_if_convertible struct enable_if_convertible
#if !defined(BOOST_NO_IS_CONVERTIBLE) && !defined(BOOST_NO_SFINAE)
: detail::enabled<
::boost::is_convertible<From, To>::value
>::template base<detail::enable_type>
#else
: mpl::identity<detail::enable_type>
#endif
{ {
# if BOOST_WORKAROUND(BOOST_MSVC, <= 1200) // Borland 551 and vc6 have a problem with the use of base class
// forwarding in this template, so we write it all out here
#if defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_SFINAE)
typedef detail::enable_type type; typedef detail::enable_type type;
# else
typedef typename detail::enabled<
::boost::is_convertible<From, To>::value
>::template base<detail::enable_type>::type type;
# endif # endif
}; };