Merge fixes from issue #2346.

[SVN r49337]
This commit is contained in:
John Maddock
2008-10-15 09:29:29 +00:00
parent e001183519
commit e4814ae18a
26 changed files with 140 additions and 20 deletions

View File

@ -18,7 +18,7 @@ namespace boost {
namespace detail {
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x600)
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x5A0)
//
// For some reason this implementation stops Borlands compiler
// from dropping cv-qualifiers, it still fails with references

View File

@ -30,7 +30,7 @@
|| BOOST_WORKAROUND(BOOST_MSVC, <= 1301) \
|| !defined(__EDG_VERSION__) && BOOST_WORKAROUND(__GNUC__, < 3) \
|| BOOST_WORKAROUND(__IBMCPP__, < 600 ) \
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \
|| BOOST_WORKAROUND(__BORLANDC__, < 0x5A0) \
|| defined(__ghs) \
|| BOOST_WORKAROUND(__HP_aCC, < 60700) \
|| BOOST_WORKAROUND(MPW_CPLUS, BOOST_TESTED_AT(0x890)) \

13
include/boost/type_traits/extent.hpp Executable file → Normal file
View File

@ -17,6 +17,15 @@ namespace boost {
namespace detail{
#if defined( __CODEGEARC__ )
// wrap the impl as main trait provides additional MPL lambda support
template < typename T, std::size_t N >
struct extent_imp {
static const std::size_t value = __array_extent(T, N);
};
#else
template <class T, std::size_t N>
struct extent_imp
{
@ -114,7 +123,9 @@ struct extent_imp<T const volatile[], 0>
};
#endif
#endif
}
#endif // non-CodeGear implementation
} // ::boost::detail
template <class T, std::size_t N = 0>
struct extent

View File

@ -153,6 +153,35 @@
# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
#endif
# if defined(__CODEGEARC__)
# include <boost/type_traits/is_same.hpp>
# include <boost/type_traits/is_reference.hpp>
# include <boost/type_traits/is_volatile.hpp>
# include <boost/type_traits/is_void.hpp>
# define BOOST_IS_UNION(T) __is_union(T)
# define BOOST_IS_POD(T) __is_pod(T)
# define BOOST_IS_EMPTY(T) __is_empty(T)
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__has_trivial_default_constructor(T) || is_void<T>::value)
# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy_constructor(T) && !is_volatile<T>::value && !is_reference<T>::value || is_void<T>::value)
# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value || is_void<T>::value)
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) || is_void<T>::value)
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_default_constructor(T) || is_void<T>::value)
# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy_constructor(T) && !is_volatile<T>::value && !is_reference<T>::value || is_void<T>::value)
# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value || is_void<T>::value)
# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
# define BOOST_IS_ABSTRACT(T) __is_abstract(T)
# define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_void<T>::value && !is_void<U>::value)
# define BOOST_IS_CLASS(T) __is_class(T)
# define BOOST_IS_CONVERTIBLE(T,U) (__is_convertible(T,U) || is_void<U>::value)
# define BOOST_IS_ENUM(T) __is_enum(T)
# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
# define BOOST_ALIGNMENT_OF(T) alignof(T)
# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
#endif
#ifndef BOOST_IS_UNION
# define BOOST_IS_UNION(T) false
#endif

View File

@ -9,16 +9,19 @@
#ifndef BOOST_TT_IS_ARITHMETIC_HPP_INCLUDED
#define BOOST_TT_IS_ARITHMETIC_HPP_INCLUDED
#if !defined( __CODEGEARC__ )
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_float.hpp>
#include <boost/type_traits/detail/ice_or.hpp>
#include <boost/config.hpp>
#endif
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
#if !defined(__CODEGEARC__)
namespace detail {
template< typename T >
@ -32,9 +35,14 @@ struct is_arithmetic_impl
};
} // namespace detail
#endif
//* is a type T an arithmetic type described in the standard (3.9.1p8)
#if defined(__CODEGEARC__)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_arithmetic,T,__is_arithmetic(T))
#else
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_arithmetic,T,::boost::detail::is_arithmetic_impl<T>::value)
#endif
} // namespace boost

View File

@ -28,8 +28,9 @@
namespace boost {
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,__is_array(T))
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,false)
#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T[N],true)

View File

@ -240,6 +240,10 @@ BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_a
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_and_derived,Base&,Derived&,false)
#endif
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610))
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename Base,is_base_and_derived,Base,Base,false)
#endif
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>

View File

@ -18,6 +18,7 @@
namespace boost {
#if !defined( __CODEGEARC__ )
namespace detail {
template <typename T>
@ -30,8 +31,13 @@ struct is_compound_impl
};
} // namespace detail
#endif // !defined( __CODEGEARC__ )
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_compound,T,__is_compound(T))
#else
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_compound,T,::boost::detail::is_compound_impl<T>::value)
#endif
} // namespace boost

View File

@ -44,7 +44,11 @@
namespace boost {
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,__is_const(T))
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
//* is a type T declared const - is_const<T>
#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
@ -54,7 +58,7 @@ namespace boost {
#endif
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T&,false)
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x600)
#if defined(BOOST_ILLEGAL_CV_REFERENCES)
// these are illegal specialisations; cv-qualifies applied to
// references have no effect according to [8.3.2p1],
// C++ Builder requires them though as it treats cv-qualified

View File

@ -32,6 +32,9 @@
// function pointers to void*.
namespace boost {
#if !defined( __CODEGEARC__ )
namespace detail {
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
@ -86,8 +89,13 @@ struct is_function_impl<T&> : public false_type
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_function,T,::boost::detail::is_function_impl<T>::value)
#endif // !defined( __CODEGEARC__ )
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_function,T,__is_function(T))
#else
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_function,T,::boost::detail::is_function_impl<T>::value)
#endif
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>

View File

@ -32,7 +32,11 @@ struct is_fundamental_impl
} // namespace detail
//* is a type T a fundamental type described in the standard (3.9.1)
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_fundamental,T,__is_fundamental(T))
#else
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_fundamental,T,::boost::detail::is_fundamental_impl<T>::value)
#endif
} // namespace boost

View File

@ -19,6 +19,9 @@ namespace boost {
//* is a type T an [cv-qualified-] integral type described in the standard (3.9.1p3)
// as an extention we include long long, as this is likely to be added to the
// standard at a later date
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_integral,T,__is_integral(T))
#else
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_integral,T,false)
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned char,true)
@ -66,6 +69,8 @@ BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true)
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true)
#endif
#endif // non-CodeGear implementation
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>

View File

@ -37,7 +37,9 @@
namespace boost {
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_function_pointer,T,__is_member_function_pointer( T ))
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(
is_member_function_pointer

View File

@ -40,7 +40,9 @@
namespace boost {
#if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,__is_member_pointer(T))
#elif BOOST_WORKAROUND(__BORLANDC__, < 0x600)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*,true)

View File

@ -42,7 +42,9 @@
namespace boost {
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pointer,T,__is_pointer(T))
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
namespace detail {

View File

@ -33,12 +33,14 @@
namespace boost {
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_reference,T,__is_reference(T))
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_reference,T,false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_reference,T&,true)
#if defined(__BORLANDC__) && !defined(__COMO__) && (__BORLANDC__ < 0x600)
#if defined(BOOST_ILLEGAL_CV_REFERENCES)
// these are illegal specialisations; cv-qualifies applied to
// references have no effect according to [8.3.2p1],
// C++ Builder requires them though as it treats cv-qualified

8
include/boost/type_traits/is_signed.hpp Executable file → Normal file
View File

@ -20,6 +20,8 @@
namespace boost {
#if !defined( __CODEGEARC__ )
namespace detail{
#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238)
@ -110,7 +112,13 @@ template <> struct is_signed_imp<const volatile wchar_t> : public true_type{};
}
#endif // !defined( __CODEGEARC__ )
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_signed,T,__is_signed(T))
#else
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_signed,T,::boost::detail::is_signed_imp<T>::value)
#endif
} // namespace boost

9
include/boost/type_traits/is_unsigned.hpp Executable file → Normal file
View File

@ -20,6 +20,8 @@
namespace boost {
#if !defined( __CODEGEARC__ )
namespace detail{
#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238)
@ -104,10 +106,15 @@ template <> struct is_unsigned_imp<const volatile wchar_t> : public true_type{};
#endif
}
#endif // !defined( __CODEGEARC__ )
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_unsigned,T,__is_unsigned(T))
#else
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_unsigned,T,::boost::detail::is_unsigned_imp<T>::value)
#endif
} // namespace boost

View File

@ -17,6 +17,9 @@
namespace boost {
//* is a type T void - is_void<T>
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_void,T,__is_void(T))
#else
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_void,T,false)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void,true)
@ -26,6 +29,8 @@ BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void volatile,true)
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void const volatile,true)
#endif
#endif // non-CodeGear implementation
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>

View File

@ -41,7 +41,9 @@
namespace boost {
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,__is_volatile(T))
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
//* is a type T declared volatile - is_volatile<T>
#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
@ -51,7 +53,7 @@ namespace boost {
#endif
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T&,false)
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x600)
#if defined(BOOST_ILLEGAL_CV_REFERENCES)
// these are illegal specialisations; cv-qualifies applied to
// references have no effect according to [8.3.2p1],
// C++ Builder requires them though as it treats cv-qualified

8
include/boost/type_traits/rank.hpp Executable file → Normal file
View File

@ -15,6 +15,8 @@
namespace boost {
#if !defined( __CODEGEARC__ )
namespace detail{
template <class T, std::size_t N>
@ -72,7 +74,13 @@ struct rank_imp<T const volatile[], N>
#endif
}
#endif // !defined( __CODEGEARC__ )
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(rank,T,__array_rank(T))
#else
BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(rank,T,(::boost::detail::rank_imp<T,0>::value))
#endif
} // namespace boost

2
include/boost/type_traits/remove_all_extents.hpp Executable file → Normal file
View File

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

View File

@ -31,7 +31,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 !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) && !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)

2
include/boost/type_traits/remove_extent.hpp Executable file → Normal file
View File

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

View File

@ -27,7 +27,7 @@ namespace boost {
BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_reference,T,T)
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T&,T)
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x600)
#if defined(BOOST_ILLEGAL_CV_REFERENCES)
// these are illegal specialisations; cv-qualifies applied to
// references have no effect according to [8.3.2p1],
// C++ Builder requires them though as it treats cv-qualified

View File

@ -357,10 +357,12 @@ namespace detail {
typedef ::boost::align::a16 max_align;
//#if ! BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610))
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a2,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a4,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a8,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a16,true)
//#endif
}
template <std::size_t N> struct type_with_alignment