MDC fixes from Daniel James

[SVN r24663]
This commit is contained in:
John Maddock
2004-08-23 11:39:22 +00:00
parent 55e2d27da4
commit fa928962a6
4 changed files with 44 additions and 4 deletions

View File

@@ -24,7 +24,7 @@
# define BOOST_TT_DECL /**/
#endif
# if (defined(__MWERKS__) && __MWERKS__ >= 0x3000) || (defined(BOOST_MSVC) && (BOOST_MSVC > 1301)) || defined(__EDG_VERSION__) || (defined(__GNUC__) && (__GNUC__ >= 3)) || defined(BOOST_NO_COMPILER_CONFIG)
# if (defined(__MWERKS__) && __MWERKS__ >= 0x3000) || (defined(BOOST_MSVC) && (BOOST_MSVC > 1301)) || defined(__EDG_VERSION__) || (defined(__GNUC__) && (__GNUC__ >= 3)) || defined(__DMC__) || defined(BOOST_NO_COMPILER_CONFIG)
# define BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION
#endif

View File

@@ -36,7 +36,7 @@ BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T[N],t
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T const[N],true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T volatile[N],true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T const volatile[N],true)
#if !(defined(__BORLANDC__) && (__BORLANDC__ < 0x600)) && !defined(__IBMCPP__)
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T[],true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T const[],true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T volatile[],true)

View File

@@ -156,6 +156,32 @@ struct is_convertible_basic_impl
);
};
#elif defined(__DMC__)
struct any_conversion
{
template <typename T> any_conversion(const volatile T&);
// we need this constructor to catch references to functions
// (which can not be cv-qualified):
template <typename T> any_conversion(T&);
};
template <typename From, typename To>
struct is_convertible_basic_impl
{
// Using '...' doesn't always work on Digital Mars. This version seems to.
template <class T>
static ::boost::type_traits::no_type BOOST_TT_DECL _m_check(any_conversion, float, T);
static ::boost::type_traits::yes_type BOOST_TT_DECL _m_check(To, int, int);
static From _m_from;
// Static constants sometime cause the conversion of _m_from to To to be
// called. This doesn't happen with an enum.
enum { value =
sizeof( _m_check(_m_from, 0, 0) ) == sizeof(::boost::type_traits::yes_type)
};
};
#else
//
@@ -176,7 +202,21 @@ struct is_convertible_basic_impl
#endif // is_convertible_impl
#if !defined(__BORLANDC__) || __BORLANDC__ > 0x551
#if defined(__DMC__)
// As before, a static constant sometimes causes errors on Digital Mars.
template <typename From, typename To>
struct is_convertible_impl
{
typedef typename add_reference<From>::type ref_type;
enum { value =
::boost::type_traits::ice_and<
::boost::detail::is_convertible_basic_impl<ref_type, To>::value,
::boost::type_traits::ice_not<
::boost::is_array<To>::value
>::value,
>::value };
};
#elif !defined(__BORLANDC__) || __BORLANDC__ > 0x551
template <typename From, typename To>
struct is_convertible_impl
{

View File

@@ -24,7 +24,7 @@ BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T const[N],T const type)
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T volatile[N],T volatile type)
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T const volatile[N],T const volatile type)
#if !(defined(__BORLANDC__) && (__BORLANDC__ < 0x600)) && !defined(__IBMCPP__)
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T[],T)
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T const[],T const)
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T volatile[],T volatile)