diff --git a/include/boost/type_traits/has_nothrow_assign.hpp b/include/boost/type_traits/has_nothrow_assign.hpp index 9bc0107..2f52924 100644 --- a/include/boost/type_traits/has_nothrow_assign.hpp +++ b/include/boost/type_traits/has_nothrow_assign.hpp @@ -16,7 +16,20 @@ namespace boost { -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_assign,T,::boost::has_trivial_assign::value) +namespace detail{ + +template +struct has_nothrow_assign_imp{ + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_or< + ::boost::has_trivial_assign::value, + BOOST_HAS_NOTHROW_ASSIGN(T) + >::value)); +}; + +} + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_assign,T,::boost::detail::has_nothrow_assign_imp::value) } // namespace boost diff --git a/include/boost/type_traits/has_nothrow_constructor.hpp b/include/boost/type_traits/has_nothrow_constructor.hpp index 8fea675..f3c7ce7 100644 --- a/include/boost/type_traits/has_nothrow_constructor.hpp +++ b/include/boost/type_traits/has_nothrow_constructor.hpp @@ -16,7 +16,20 @@ namespace boost { -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_constructor,T,::boost::has_trivial_constructor::value) +namespace detail{ + +template +struct has_nothrow_constructor_imp{ + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_or< + ::boost::has_trivial_constructor::value, + BOOST_HAS_NOTHROW_CONSTRUCTOR(T) + >::value)); +}; + +} + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_constructor,T,::boost::detail::has_nothrow_constructor_imp::value) } // namespace boost diff --git a/include/boost/type_traits/has_nothrow_copy.hpp b/include/boost/type_traits/has_nothrow_copy.hpp index dd9a826..5c83412 100644 --- a/include/boost/type_traits/has_nothrow_copy.hpp +++ b/include/boost/type_traits/has_nothrow_copy.hpp @@ -16,7 +16,20 @@ namespace boost { -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_copy,T,::boost::has_trivial_copy::value) +namespace detail{ + +template +struct has_nothrow_copy_imp{ + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_or< + ::boost::has_trivial_copy::value, + BOOST_HAS_NOTHROW_COPY(T) + >::value)); +}; + +} + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_copy,T,::boost::detail::has_nothrow_copy_imp::value) } // namespace boost diff --git a/include/boost/type_traits/has_virtual_destructor.hpp b/include/boost/type_traits/has_virtual_destructor.hpp index 9524f4e..4d15704 100755 --- a/include/boost/type_traits/has_virtual_destructor.hpp +++ b/include/boost/type_traits/has_virtual_destructor.hpp @@ -10,12 +10,13 @@ #ifndef BOOST_TT_HAS_VIRTUAL_DESTRUCTOR_HPP_INCLUDED #define BOOST_TT_HAS_VIRTUAL_DESTRUCTOR_HPP_INCLUDED +#include // should be the last #include #include "boost/type_traits/detail/bool_trait_def.hpp" namespace boost { -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_virtual_destructor,T,false) +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_virtual_destructor,T,BOOST_HAS_VIRTUAL_DESTRUCTOR(T)) } // namespace boost diff --git a/include/boost/type_traits/intrinsics.hpp b/include/boost/type_traits/intrinsics.hpp index 55f22e3..f993613 100644 --- a/include/boost/type_traits/intrinsics.hpp +++ b/include/boost/type_traits/intrinsics.hpp @@ -27,6 +27,10 @@ // BOOST_HAS_TRIVIAL_COPY(T) should evaluate to true if T(t) <==> memcpy // BOOST_HAS_TRIVIAL_ASSIGN(T) should evaluate to true if t = u <==> memcpy // BOOST_HAS_TRIVIAL_DESTRUCTOR(T) should evaluate to true if ~T() has no effect +// BOOST_HAS_NOTHROW_CONSTRUCTOR(T) should evaluate to true if "T x;" can not throw +// BOOST_HAS_NOTHROW_COPY(T) should evaluate to true if T(t) can not throw +// BOOST_HAS_NOTHROW_ASSIGN(T) should evaluate to true if t = u can not throw +// BOOST_HAS_VIRTUAL_DESTRUCTOR(T) should evaluate to true T has a virtual destructor #ifdef BOOST_HAS_SGI_TYPE_TRAITS // Hook into SGI's __type_traits class, this will pick up user supplied @@ -59,6 +63,22 @@ # define BOOST_HAS_TYPE_TRAITS_INTRINSICS #endif +#if defined(BOOST_MSVC) && defined(_MSC_FULL_VER) && (_MSC_FULL_VER >=140050215) +# 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) +# 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_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T) +# define BOOST_HAS_TYPE_TRAITS_INTRINSICS +#endif + + #ifndef BOOST_IS_UNION # define BOOST_IS_UNION(T) false #endif @@ -87,6 +107,22 @@ # 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