forked from boostorg/type_traits
Update type_traits tests to reflect C++0x.
Make better/simpler use of C++0x intrinsics where available. Change a few traits to C++0x behaviour. Update docs to reflect current intrinsic availability. [SVN r70057]
This commit is contained in:
1 parent
ee29b7660f
commit
087d133793
52 files changed
+434
-220
No files matched your search
@@ -20,16 +20,22 @@ namespace detail{
|
||||
|
||||
template <class T>
|
||||
struct has_nothrow_assign_imp{
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_or<
|
||||
::boost::has_trivial_assign<T>::value,
|
||||
BOOST_HAS_NOTHROW_ASSIGN(T)
|
||||
>::value));
|
||||
#ifndef BOOST_HAS_NOTHROW_ASSIGN
|
||||
BOOST_STATIC_CONSTANT(bool, value = ::boost::has_trivial_assign<T>::value);
|
||||
#else
|
||||
BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_ASSIGN(T));
|
||||
#endif
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_assign,T,::boost::detail::has_nothrow_assign_imp<T>::value)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void,false)
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void const,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void const volatile,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void volatile,false)
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -20,11 +20,11 @@ namespace detail{
|
||||
|
||||
template <class T>
|
||||
struct has_nothrow_constructor_imp{
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_or<
|
||||
::boost::has_trivial_constructor<T>::value,
|
||||
BOOST_HAS_NOTHROW_CONSTRUCTOR(T)
|
||||
>::value));
|
||||
#ifdef BOOST_HAS_NOTHROW_CONSTRUCTOR
|
||||
BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_CONSTRUCTOR(T));
|
||||
#else
|
||||
BOOST_STATIC_CONSTANT(bool, value = ::boost::has_trivial_constructor<T>::value);
|
||||
#endif
|
||||
};
|
||||
|
||||
}
|
||||
@@ -32,6 +32,20 @@ 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)
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void,false)
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void const,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void const volatile,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void volatile,false)
|
||||
#endif
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void,false)
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void const,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void const volatile,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void volatile,false)
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/type_traits/detail/bool_trait_undef.hpp>
|
||||
|
||||
@@ -20,11 +20,11 @@ namespace detail{
|
||||
|
||||
template <class T>
|
||||
struct has_nothrow_copy_imp{
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_or<
|
||||
::boost::has_trivial_copy<T>::value,
|
||||
BOOST_HAS_NOTHROW_COPY(T)
|
||||
>::value));
|
||||
#ifdef BOOST_HAS_NOTHROW_COPY
|
||||
BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_COPY(T));
|
||||
#else
|
||||
BOOST_STATIC_CONSTANT(bool, value = ::boost::has_trivial_copy<T>::value);
|
||||
#endif
|
||||
};
|
||||
|
||||
}
|
||||
@@ -32,6 +32,20 @@ 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)
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void,false)
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void const,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void const volatile,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void volatile,false)
|
||||
#endif
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void,false)
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void const,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void const volatile,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void volatile,false)
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/type_traits/detail/bool_trait_undef.hpp>
|
||||
|
||||
@@ -28,20 +28,27 @@ namespace detail {
|
||||
template <typename T>
|
||||
struct has_trivial_assign_impl
|
||||
{
|
||||
#ifdef BOOST_HAS_TRIVIAL_ASSIGN
|
||||
BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_ASSIGN(T));
|
||||
#else
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_and<
|
||||
::boost::type_traits::ice_or<
|
||||
::boost::is_pod<T>::value,
|
||||
BOOST_HAS_TRIVIAL_ASSIGN(T)
|
||||
>::value,
|
||||
::boost::type_traits::ice_not< ::boost::is_const<T>::value >::value,
|
||||
::boost::is_pod<T>::value,
|
||||
::boost::type_traits::ice_not< ::boost::is_const<T>::value >::value,
|
||||
::boost::type_traits::ice_not< ::boost::is_volatile<T>::value >::value
|
||||
>::value));
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_assign,T,::boost::detail::has_trivial_assign_impl<T>::value)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void,false)
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void const,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void const volatile,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void volatile,false)
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -24,11 +24,19 @@ namespace detail {
|
||||
template <typename T>
|
||||
struct has_trivial_ctor_impl
|
||||
{
|
||||
#ifdef BOOST_HAS_TRIVIAL_CONSTRUCTOR
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_or<
|
||||
::boost::is_pod<T>::value,
|
||||
BOOST_HAS_TRIVIAL_CONSTRUCTOR(T)
|
||||
>::value));
|
||||
#else
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_or<
|
||||
::boost::is_pod<T>::value,
|
||||
false
|
||||
>::value));
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
@@ -27,14 +27,15 @@ namespace detail {
|
||||
template <typename T>
|
||||
struct has_trivial_copy_impl
|
||||
{
|
||||
#ifdef BOOST_HAS_TRIVIAL_COPY
|
||||
BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_COPY(T));
|
||||
#else
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_and<
|
||||
::boost::type_traits::ice_or<
|
||||
::boost::is_pod<T>::value,
|
||||
BOOST_HAS_TRIVIAL_COPY(T)
|
||||
>::value,
|
||||
::boost::type_traits::ice_not< ::boost::is_volatile<T>::value >::value
|
||||
::boost::is_pod<T>::value,
|
||||
::boost::type_traits::ice_not< ::boost::is_volatile<T>::value >::value
|
||||
>::value));
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
@@ -42,6 +43,20 @@ struct has_trivial_copy_impl
|
||||
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)
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void,false)
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void const,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void const volatile,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void volatile,false)
|
||||
#endif
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void,false)
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void const,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void const volatile,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void volatile,false)
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/type_traits/detail/bool_trait_undef.hpp>
|
||||
|
||||
@@ -24,17 +24,24 @@ namespace detail {
|
||||
template <typename T>
|
||||
struct has_trivial_dtor_impl
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_or<
|
||||
::boost::is_pod<T>::value,
|
||||
BOOST_HAS_TRIVIAL_DESTRUCTOR(T)
|
||||
>::value));
|
||||
#ifdef BOOST_HAS_TRIVIAL_DESTRUCTOR
|
||||
BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_DESTRUCTOR(T));
|
||||
#else
|
||||
BOOST_STATIC_CONSTANT(bool, value = ::boost::is_pod<T>::value);
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_destructor,T,::boost::detail::has_trivial_dtor_impl<T>::value)
|
||||
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void,false)
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void const,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void const volatile,false)
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void volatile,false)
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/type_traits/detail/bool_trait_undef.hpp>
|
||||
|
||||
Executable → Regular
+4
@@ -16,7 +16,11 @@
|
||||
|
||||
namespace boost {
|
||||
|
||||
#ifdef BOOST_HAS_VIRTUAL_DESTRUCTOR
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_virtual_destructor,T,BOOST_HAS_VIRTUAL_DESTRUCTOR(T))
|
||||
#else
|
||||
BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_virtual_destructor,T,false)
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -33,8 +33,6 @@
|
||||
// BOOST_HAS_VIRTUAL_DESTRUCTOR(T) should evaluate to true T has a virtual destructor
|
||||
//
|
||||
// The following can also be defined: when detected our implementation is greatly simplified.
|
||||
// Note that unlike the macros above these do not have default definitions, so we can use
|
||||
// #ifdef MACRONAME to detect when these are available.
|
||||
//
|
||||
// BOOST_IS_ABSTRACT(T) true if T is an abstract type
|
||||
// BOOST_IS_BASE_OF(T,U) true if T is a base class of U
|
||||
@@ -89,12 +87,12 @@
|
||||
# define BOOST_IS_POD(T) (__is_pod(T) && __has_trivial_constructor(T))
|
||||
# define BOOST_IS_EMPTY(T) __is_empty(T)
|
||||
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) __has_trivial_copy(T)
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) __has_trivial_assign(T)
|
||||
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
|
||||
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
|
||||
# define BOOST_HAS_NOTHROW_COPY(T) __has_nothrow_copy(T)
|
||||
# define BOOST_HAS_NOTHROW_ASSIGN(T) __has_nothrow_assign(T)
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T)|| ( ::boost::is_pod<T>::value && !::boost::is_volatile<T>::value))
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) || ( ::boost::is_pod<T>::value && ! ::boost::is_const<T>::value && !::boost::is_volatile<T>::value))
|
||||
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) || ::boost::is_pod<T>::value)
|
||||
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) || ::boost::has_trivial_constructor<T>::value)
|
||||
# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) || ::boost::has_trivial_copy<T>::value)
|
||||
# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) || ::boost::has_trivial_assign<T>::value)
|
||||
# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
|
||||
|
||||
# define BOOST_IS_ABSTRACT(T) __is_abstract(T)
|
||||
@@ -134,9 +132,9 @@
|
||||
# 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_constructor(T)
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) __has_trivial_assign(T)
|
||||
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__has_trivial_constructor(T) && ! ::boost::is_volatile<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value && ! ::boost::is_volatile<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && ! ::boost::is_volatile<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
|
||||
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
|
||||
# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile<T>::value && !is_reference<T>::value)
|
||||
@@ -167,8 +165,8 @@
|
||||
# define BOOST_IS_POD(T) __is_pod(T)
|
||||
# define BOOST_IS_EMPTY(T) __is_empty(T)
|
||||
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) __has_trivial_assign(T)
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value && && !is_volatile<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
|
||||
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
|
||||
# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile<T>::value && !is_reference<T>::value)
|
||||
@@ -194,13 +192,13 @@
|
||||
# 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_TRIVIAL_CONSTRUCTOR(T) (__has_trivial_default_constructor(T))
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy_constructor(T) && !is_volatile<T>::value && !is_reference<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T))
|
||||
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_default_constructor(T))
|
||||
# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy_constructor(T) && !is_volatile<T>::value && !is_reference<T>::value)
|
||||
# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value)
|
||||
# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
|
||||
|
||||
# define BOOST_IS_ABSTRACT(T) __is_abstract(T)
|
||||
@@ -214,50 +212,6 @@
|
||||
# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_IS_UNION
|
||||
# define BOOST_IS_UNION(T) false
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_IS_POD
|
||||
# define BOOST_IS_POD(T) false
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_IS_EMPTY
|
||||
# define BOOST_IS_EMPTY(T) false
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_HAS_TRIVIAL_CONSTRUCTOR
|
||||
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) false
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_HAS_TRIVIAL_COPY
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) false
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_HAS_TRIVIAL_ASSIGN
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) false
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_HAS_TRIVIAL_DESTRUCTOR
|
||||
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) false
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_HAS_NOTHROW_CONSTRUCTOR
|
||||
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) false
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_HAS_NOTHROW_COPY
|
||||
# define BOOST_HAS_NOTHROW_COPY(T) false
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_HAS_NOTHROW_ASSIGN
|
||||
# define BOOST_HAS_NOTHROW_ASSIGN(T) false
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_HAS_VIRTUAL_DESTRUCTOR
|
||||
# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) false
|
||||
#endif
|
||||
|
||||
#endif // BOOST_TT_INTRINSICS_HPP_INCLUDED
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,12 @@
|
||||
// should be always the last #include directive
|
||||
#include <boost/type_traits/detail/bool_trait_def.hpp>
|
||||
|
||||
#ifndef BOOST_INTERNAL_IS_EMPTY
|
||||
#define BOOST_INTERNAL_IS_EMPTY(T) false
|
||||
#else
|
||||
#define BOOST_INTERNAL_IS_EMPTY(T) BOOST_IS_EMPTY(T)
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace detail {
|
||||
@@ -83,7 +89,7 @@ struct is_empty_impl
|
||||
bool, value = (
|
||||
::boost::type_traits::ice_or<
|
||||
::boost::detail::empty_helper<cvt,::boost::is_class<T>::value>::value
|
||||
, BOOST_IS_EMPTY(cvt)
|
||||
, BOOST_INTERNAL_IS_EMPTY(cvt)
|
||||
>::value
|
||||
));
|
||||
};
|
||||
@@ -118,7 +124,7 @@ struct is_empty_impl
|
||||
, ::boost::is_class<T>::value
|
||||
, ::boost::is_convertible< r_type,int>::value
|
||||
>::value
|
||||
, BOOST_IS_EMPTY(cvt)
|
||||
, BOOST_INTERNAL_IS_EMPTY(cvt)
|
||||
>::value));
|
||||
};
|
||||
|
||||
@@ -187,14 +193,14 @@ struct is_empty_impl
|
||||
typedef typename result::type eh_type;
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
(::boost::type_traits::ice_or<eh_type::value, BOOST_IS_EMPTY(T)>::value));
|
||||
(::boost::type_traits::ice_or<eh_type::value, BOOST_INTERNAL_IS_EMPTY(T)>::value));
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
template <typename T> struct is_empty_impl
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_EMPTY(T));
|
||||
BOOST_STATIC_CONSTANT(bool, value = BOOST_INTERNAL_IS_EMPTY(T));
|
||||
};
|
||||
|
||||
#endif // BOOST_MSVC6_MEMBER_TEMPLATES
|
||||
@@ -217,5 +223,7 @@ BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_empty,T,::boost::detail::is_empty_impl<T>::value
|
||||
|
||||
#include <boost/type_traits/detail/bool_trait_undef.hpp>
|
||||
|
||||
#undef BOOST_INTERNAL_IS_EMPTY
|
||||
|
||||
#endif // BOOST_TT_IS_EMPTY_HPP_INCLUDED
|
||||
|
||||
@@ -20,6 +20,12 @@
|
||||
// should be the last #include
|
||||
#include <boost/type_traits/detail/bool_trait_def.hpp>
|
||||
|
||||
#ifndef BOOST_IS_POD
|
||||
#define BOOST_INTERNAL_IS_POD(T) false
|
||||
#else
|
||||
#define BOOST_INTERNAL_IS_POD(T) BOOST_IS_POD(T)
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
// forward declaration, needed by 'is_pod_array_helper' template below
|
||||
@@ -36,7 +42,7 @@ template <typename T> struct is_pod_impl
|
||||
(::boost::type_traits::ice_or<
|
||||
::boost::is_scalar<T>::value,
|
||||
::boost::is_void<T>::value,
|
||||
BOOST_IS_POD(T)
|
||||
BOOST_INTERNAL_IS_POD(T)
|
||||
>::value));
|
||||
};
|
||||
|
||||
@@ -60,7 +66,7 @@ struct is_pod_helper
|
||||
(::boost::type_traits::ice_or<
|
||||
::boost::is_scalar<T>::value,
|
||||
::boost::is_void<T>::value,
|
||||
BOOST_IS_POD(T)
|
||||
BOOST_INTERNAL_IS_POD(T)
|
||||
>::value));
|
||||
};
|
||||
};
|
||||
@@ -132,4 +138,6 @@ BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pod,T,::boost::detail::is_pod_impl<T>::value)
|
||||
|
||||
#include <boost/type_traits/detail/bool_trait_undef.hpp>
|
||||
|
||||
#undef BOOST_INTERNAL_IS_POD
|
||||
|
||||
#endif // BOOST_TT_IS_POD_HPP_INCLUDED
|
||||
@@ -25,7 +25,11 @@ namespace detail {
|
||||
template <typename T> struct is_union_impl
|
||||
{
|
||||
typedef typename remove_cv<T>::type cvt;
|
||||
#ifdef BOOST_IS_UNION
|
||||
BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(cvt));
|
||||
#else
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
#endif
|
||||
};
|
||||
#else
|
||||
//
|
||||
@@ -35,7 +39,11 @@ template <typename T> struct is_union_impl
|
||||
//
|
||||
template <typename T> struct is_union_impl
|
||||
{
|
||||
#ifdef BOOST_IS_UNION
|
||||
BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(T));
|
||||
#else
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
} // namespace detail
|
||||
|
||||
Reference in new issue
Block a user