Full merge from trunk at revision 41356 of entire boost-root tree.

[SVN r41369]
This commit is contained in:
Beman Dawes
2007-11-25 18:07:19 +00:00
19 changed files with 102 additions and 12 deletions

View File

@@ -70,6 +70,15 @@
#include "boost/type_traits/type_with_alignment.hpp"
#include "boost/type_traits/function_traits.hpp"
#include "boost/type_traits/aligned_storage.hpp"
#include "boost/type_traits/floating_point_promotion.hpp"
#if !(defined(__sgi) && defined(__EDG_VERSION__) && (__EDG_VERSION__ == 238))
#include "boost/type_traits/integral_promotion.hpp"
#include "boost/type_traits/promote.hpp"
#endif
#include <boost/type_traits/make_unsigned.hpp>
#include <boost/type_traits/make_signed.hpp>
#include <boost/type_traits/decay.hpp>
#include <boost/type_traits/is_complex.hpp>
#include "boost/type_traits/ice.hpp"

View File

@@ -32,9 +32,9 @@
|| BOOST_WORKAROUND(__IBMCPP__, < 600 ) \
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) \
|| defined(__ghs) \
|| BOOST_WORKAROUND(__HP_aCC, BOOST_TESTED_AT(53800)) \
|| BOOST_WORKAROUND(__HP_aCC, < 60700) \
|| BOOST_WORKAROUND(MPW_CPLUS, BOOST_TESTED_AT(0x890)) \
|| BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580)) ) \
|| BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))) \
&& defined(BOOST_NO_IS_ABSTRACT)
# define BOOST_TT_NO_CONFORMING_IS_CLASS_IMPLEMENTATION 1

View File

@@ -166,7 +166,7 @@ struct function_traits_helper<R (*)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)>
template<typename Function>
struct function_traits :
public detail::function_traits_helper<typename boost::add_pointer<Function>::type>
public detail::function_traits_helper<typename boost::add_pointer<Function>::type>
{
};

View File

@@ -30,6 +30,7 @@ struct has_nothrow_constructor_imp{
}
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_constructor,T,::boost::detail::has_nothrow_constructor_imp<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_default_constructor,T,::boost::detail::has_nothrow_constructor_imp<T>::value)
} // namespace boost

View File

@@ -30,6 +30,7 @@ struct has_nothrow_copy_imp{
}
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_copy,T,::boost::detail::has_nothrow_copy_imp<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_copy_constructor,T,::boost::detail::has_nothrow_copy_imp<T>::value)
} // namespace boost

View File

@@ -34,6 +34,7 @@ struct has_trivial_ctor_impl
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_constructor,T,::boost::detail::has_trivial_ctor_impl<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_default_constructor,T,::boost::detail::has_trivial_ctor_impl<T>::value)
} // namespace boost

View File

@@ -40,6 +40,7 @@ struct has_trivial_copy_impl
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_copy,T,::boost::detail::has_trivial_copy_impl<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_copy_constructor,T,::boost::detail::has_trivial_copy_impl<T>::value)
} // namespace boost

View File

@@ -85,6 +85,21 @@
# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
#endif
#if defined(__DMC__) && (__DMC__ >= 0x848)
// For Digital Mars C++, www.digitalmars.com
# define BOOST_IS_UNION(T) (__typeinfo(T) & 0x400)
# define BOOST_IS_POD(T) (__typeinfo(T) & 0x800)
# define BOOST_IS_EMPTY(T) (__typeinfo(T) & 0x1000)
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__typeinfo(T) & 0x10)
# define BOOST_HAS_TRIVIAL_COPY(T) (__typeinfo(T) & 0x20)
# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__typeinfo(T) & 0x40)
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__typeinfo(T) & 0x8)
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__typeinfo(T) & 0x80)
# define BOOST_HAS_NOTHROW_COPY(T) (__typeinfo(T) & 0x100)
# define BOOST_HAS_NOTHROW_ASSIGN(T) (__typeinfo(T) & 0x200)
# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) (__typeinfo(T) & 0x4)
# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
#endif
#ifndef BOOST_IS_UNION
# define BOOST_IS_UNION(T) false
@@ -135,3 +150,4 @@

View File

@@ -85,7 +85,14 @@ struct is_abstract_imp2
#ifdef __GNUC__
BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(is_abstract_imp2<T>::template check_sig<T>(0)));
#else
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
#pragma warning(push)
#pragma warning(disable:6334)
#endif
BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(check_sig<T>(0)));
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
#pragma warning(pop)
#endif
#endif
BOOST_STATIC_CONSTANT(bool, value =

View File

@@ -15,6 +15,7 @@
#include <boost/type_traits/detail/ice_and.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/config.hpp>
#include <boost/static_assert.hpp>
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
@@ -128,6 +129,17 @@ struct bd_helper
template<typename B, typename D>
struct is_base_and_derived_impl2
{
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
#pragma warning(push)
#pragma warning(disable:6334)
#endif
//
// May silently do the wrong thing with incomplete types
// unless we trap them here:
//
BOOST_STATIC_ASSERT(sizeof(B) != 0);
BOOST_STATIC_ASSERT(sizeof(D) != 0);
struct Host
{
#if !BOOST_WORKAROUND(BOOST_MSVC, == 1310)
@@ -140,6 +152,9 @@ struct is_base_and_derived_impl2
BOOST_STATIC_CONSTANT(bool, value =
sizeof(bd_helper<B,D>::check_sig(Host(), 0)) == sizeof(type_traits::yes_type));
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
#pragma warning(pop)
#endif
};
#else
@@ -220,4 +235,3 @@ BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_a
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED

View File

@@ -116,7 +116,7 @@ struct is_class_impl
# ifdef __EDG_VERSION__
BOOST_TT_AUX_BOOL_TRAIT_DEF1(
is_class,T, detail::is_class_impl<typename boost::remove_cv<T>::type>::value)
is_class,T, boost::detail::is_class_impl<typename boost::remove_cv<T>::type>::value)
# else
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_class,T,::boost::detail::is_class_impl<T>::value)
# endif

View File

@@ -250,6 +250,9 @@ struct is_convertible_basic_impl
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable:4244)
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
#pragma warning(disable:6334)
#endif
#endif
BOOST_STATIC_CONSTANT(bool, value =
sizeof( _m_check(_m_from) ) == sizeof(::boost::type_traits::yes_type)
@@ -413,4 +416,3 @@ BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_convertible,From,To,(::boost::detail::is_convert
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_IS_CONVERTIBLE_HPP_INCLUDED

View File

@@ -62,11 +62,18 @@ struct is_function_impl
template <typename T>
struct is_function_impl
{
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
#pragma warning(push)
#pragma warning(disable:6334)
#endif
static T* t;
BOOST_STATIC_CONSTANT(
bool, value = sizeof(::boost::type_traits::is_function_ptr_tester(t))
== sizeof(::boost::type_traits::yes_type)
);
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
#pragma warning(pop)
#endif
};
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)

View File

@@ -41,6 +41,8 @@ BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char,true)
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true)
#endif
// Same set of integral types as in boost/type_traits/integral_promotion.hpp.
// Please, keep in sync. -- Alexander Nasonov
#if (defined(BOOST_MSVC) && (BOOST_MSVC < 1300)) \
|| (defined(BOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) && (BOOST_INTEL_CXX_VERSION <= 600)) \
|| (defined(__BORLANDC__) && (__BORLANDC__ == 0x600) && (_MSC_VER < 1300))

View File

@@ -22,6 +22,7 @@
// version does not do so.
//
# include <boost/type_traits/detail/is_mem_fun_pointer_impl.hpp>
# include <boost/type_traits/remove_cv.hpp>
#else
# include <boost/type_traits/is_reference.hpp>
# include <boost/type_traits/is_array.hpp>
@@ -41,7 +42,7 @@ namespace boost {
BOOST_TT_AUX_BOOL_TRAIT_DEF1(
is_member_function_pointer
, T
, ::boost::type_traits::is_mem_fun_pointer_impl<T>::value
, ::boost::type_traits::is_mem_fun_pointer_impl<typename remove_cv<T>::type>::value
)
#else
@@ -61,6 +62,10 @@ struct is_mem_fun_pointer_select<false>
{
template <typename T> struct result_
{
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
#pragma warning(push)
#pragma warning(disable:6334)
#endif
static T* make_t;
typedef result_<T> self_type;
@@ -68,6 +73,9 @@ struct is_mem_fun_pointer_select<false>
bool, value = (
1 == sizeof(::boost::type_traits::is_mem_fun_pointer_tester(self_type::make_t))
));
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
#pragma warning(pop)
#endif
};
};

View File

@@ -48,6 +48,12 @@ BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,::boost::is_member_function_pointer<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*,true)
#if !BOOST_WORKAROUND(__MWERKS__,<=0x3003)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*const,true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*volatile,true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*const volatile,true)
#endif
#else // no partial template specialization
namespace detail {

View File

@@ -25,6 +25,9 @@
#include <boost/type_traits/detail/ice_and.hpp>
#include <boost/type_traits/detail/ice_not.hpp>
#include <boost/type_traits/config.hpp>
#if !BOOST_WORKAROUND(BOOST_MSVC,<=1300)
#include <boost/type_traits/remove_cv.hpp>
#endif
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
# include <boost/type_traits/is_reference.hpp>
@@ -56,15 +59,13 @@ template< typename T > struct helper<sp> \
/**/
TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T*,true)
TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T* const,true)
TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T* volatile,true)
TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T* const volatile,true)
# undef TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC
template< typename T >
struct is_pointer_impl
{
#if BOOST_WORKAROUND(BOOST_MSVC,<=1300)
BOOST_STATIC_CONSTANT(bool, value =
(::boost::type_traits::ice_and<
::boost::detail::is_pointer_helper<T>::value
@@ -73,6 +74,16 @@ struct is_pointer_impl
>::value
>::value)
);
#else
BOOST_STATIC_CONSTANT(bool, value =
(::boost::type_traits::ice_and<
::boost::detail::is_pointer_helper<typename remove_cv<T>::type>::value
, ::boost::type_traits::ice_not<
::boost::is_member_pointer<T>::value
>::value
>::value)
);
#endif
};
} // namespace detail

View File

@@ -11,6 +11,7 @@
#define BOOST_TT_IS_SIGNED_HPP_INCLUDED
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/is_enum.hpp>
#include <boost/type_traits/detail/ice_or.hpp>
@@ -26,7 +27,8 @@ namespace detail{
template <class T>
struct is_signed_helper
{
BOOST_STATIC_CONSTANT(bool, value = (static_cast<T>(-1) < 0));
typedef typename remove_cv<T>::type no_cv_t;
BOOST_STATIC_CONSTANT(bool, value = (static_cast<no_cv_t>(-1) < 0));
};
template <bool integral_type>

View File

@@ -12,6 +12,7 @@
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_enum.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/detail/ice_or.hpp>
// should be the last #include
@@ -26,7 +27,8 @@ namespace detail{
template <class T>
struct is_ununsigned_helper
{
BOOST_STATIC_CONSTANT(bool, value = (static_cast<T>(-1) > 0));
typedef typename remove_cv<T>::type no_cv_t;
BOOST_STATIC_CONSTANT(bool, value = (static_cast<no_cv_t>(-1) > 0));
};
template <bool integral_type>