diff --git a/include/boost/type_traits/has_nothrow_assign.hpp b/include/boost/type_traits/has_nothrow_assign.hpp index 0be0b2f..9458ef3 100644 --- a/include/boost/type_traits/has_nothrow_assign.hpp +++ b/include/boost/type_traits/has_nothrow_assign.hpp @@ -15,12 +15,13 @@ #if !defined(BOOST_HAS_NOTHROW_ASSIGN) || defined(BOOST_MSVC) || defined(BOOST_INTEL) #include #if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) -#include +#include #include #include #include #include #include +#include #endif #endif #if defined(__GNUC__) || defined(__SUNPRO_CC) diff --git a/include/boost/type_traits/has_nothrow_copy.hpp b/include/boost/type_traits/has_nothrow_copy.hpp index 1d4ae0e..a62476c 100644 --- a/include/boost/type_traits/has_nothrow_copy.hpp +++ b/include/boost/type_traits/has_nothrow_copy.hpp @@ -16,7 +16,7 @@ #if defined(BOOST_CLANG) || defined(__GNUC__) || defined(__ghs__) || defined(__CODEGEARC__) #include -#include +#include #include #ifdef BOOST_INTEL #include @@ -32,8 +32,8 @@ template struct has_nothrow_copy_constructor : public integral_constan #elif !defined(BOOST_NO_CXX11_NOEXCEPT) -#include -#include +#include +#include namespace boost{ @@ -42,11 +42,11 @@ namespace detail{ template struct has_nothrow_copy_constructor_imp : public boost::integral_constant{}; template -struct has_nothrow_copy_constructor_imp : public boost::integral_constant()))>{}; +struct has_nothrow_copy_constructor_imp : public boost::integral_constant()))>{}; } -template struct has_nothrow_copy_constructor : public detail::has_nothrow_copy_constructor_imp::value>{}; +template struct has_nothrow_copy_constructor : public detail::has_nothrow_copy_constructor_imp::value>{}; template struct has_nothrow_copy_constructor : public integral_constant{}; template struct has_nothrow_copy_constructor : public integral_constant{}; template struct has_nothrow_copy_constructor : public integral_constant{}; diff --git a/include/boost/type_traits/has_nothrow_destructor.hpp b/include/boost/type_traits/has_nothrow_destructor.hpp index a3cf832..7132a6b 100644 --- a/include/boost/type_traits/has_nothrow_destructor.hpp +++ b/include/boost/type_traits/has_nothrow_destructor.hpp @@ -13,7 +13,7 @@ #if !defined(BOOST_NO_CXX11_NOEXCEPT) -#include +#include #include namespace boost{ @@ -23,7 +23,7 @@ namespace boost{ template struct has_nothrow_destructor_imp : public boost::integral_constant{}; template - struct has_nothrow_destructor_imp : public boost::integral_constant()->~T())>{}; + struct has_nothrow_destructor_imp : public boost::integral_constant()->~T())>{}; } diff --git a/include/boost/type_traits/intrinsics.hpp b/include/boost/type_traits/intrinsics.hpp index b78e1eb..04d7ef7 100644 --- a/include/boost/type_traits/intrinsics.hpp +++ b/include/boost/type_traits/intrinsics.hpp @@ -244,7 +244,7 @@ # define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__has_trivial_assign(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile::value && ! ::boost::is_const::value && is_assignable::value) # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) BOOST_INTEL_TT_OPTS && is_destructible::value) # define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) && is_default_constructible::value BOOST_INTEL_TT_OPTS) -# define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) BOOST_INTEL_TT_OPTS) && !is_volatile::value && !is_reference::value && is_constructible::value) +# define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) BOOST_INTEL_TT_OPTS) && !is_volatile::value && !is_reference::value && is_copy_constructible::value) # define BOOST_HAS_NOTHROW_ASSIGN(T) ((__has_nothrow_assign(T) BOOST_INTEL_TT_OPTS) && !is_volatile::value && !is_const::value && is_assignable::value) # define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T) diff --git a/include/boost/type_traits/is_assignable.hpp b/include/boost/type_traits/is_assignable.hpp index 1095f80..9cf681d 100644 --- a/include/boost/type_traits/is_assignable.hpp +++ b/include/boost/type_traits/is_assignable.hpp @@ -21,7 +21,7 @@ namespace boost{ #if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) #include -#include +#include namespace boost{ @@ -29,7 +29,7 @@ namespace boost{ struct is_assignable_imp { - template() = tt_declval())> + template() = boost::declval())> static boost::type_traits::yes_type test(int); template diff --git a/include/boost/type_traits/is_constructible.hpp b/include/boost/type_traits/is_constructible.hpp index 9b7abe8..e3dc31b 100644 --- a/include/boost/type_traits/is_constructible.hpp +++ b/include/boost/type_traits/is_constructible.hpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include namespace boost{ @@ -25,12 +25,12 @@ namespace boost{ struct is_constructible_imp { - template()...))> + template()...))> static boost::type_traits::yes_type test(int); template static boost::type_traits::no_type test(...); - template()))> + template()))> static boost::type_traits::yes_type test1(int); template static boost::type_traits::no_type test1(...); @@ -45,8 +45,8 @@ namespace boost{ template struct is_constructible : public integral_constant(0)) == sizeof(boost::type_traits::yes_type)>{}; template struct is_constructible : public integral_constant::value && sizeof(detail::is_constructible_imp::test1(0)) == sizeof(boost::type_traits::yes_type)>{}; - template struct is_constructible : public integral_constant(detail::tt_declval())) == sizeof(boost::type_traits::yes_type)>{}; - template struct is_constructible : public integral_constant(detail::tt_declval())) == sizeof(boost::type_traits::yes_type)>{}; + template struct is_constructible : public integral_constant(boost::declval())) == sizeof(boost::type_traits::yes_type)>{}; + template struct is_constructible : public integral_constant(boost::declval())) == sizeof(boost::type_traits::yes_type)>{}; template <> struct is_constructible : public false_type{}; template <> struct is_constructible : public false_type{}; diff --git a/include/boost/type_traits/is_copy_constructible.hpp b/include/boost/type_traits/is_copy_constructible.hpp index 03c0460..fc95cf0 100644 --- a/include/boost/type_traits/is_copy_constructible.hpp +++ b/include/boost/type_traits/is_copy_constructible.hpp @@ -69,7 +69,7 @@ namespace boost { #include #include #include -#include +#include #include namespace boost { @@ -137,7 +137,7 @@ namespace boost { // }; BOOST_STATIC_CONSTANT(bool, value = ( sizeof(test( - tt_declval::type*/ const T&>() + boost::declval::type*/ const T&>() )) == sizeof(boost::type_traits::yes_type) && !boost::is_rvalue_reference::value diff --git a/include/boost/type_traits/is_destructible.hpp b/include/boost/type_traits/is_destructible.hpp index 36fc626..9f1e5d9 100644 --- a/include/boost/type_traits/is_destructible.hpp +++ b/include/boost/type_traits/is_destructible.hpp @@ -15,7 +15,7 @@ #if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) #include -#include +#include namespace boost{ @@ -23,7 +23,7 @@ namespace boost{ struct is_destructible_imp { - template().~T())> + template().~T())> static boost::type_traits::yes_type test(int); template static boost::type_traits::no_type test(...); diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 8dd1891..c799160 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -29,6 +29,9 @@ rule all-tests { { result += [ run $(source) ] ; } + # + # These traits have both intrinsic support, and a std conforming version, test a version with intrinsics disabled for better code coverage: + # for local source in has_nothrow_assign_test has_nothrow_constr_test has_nothrow_copy_test is_nothrow_move_assignable_test is_nothrow_move_constructible_test { result += [ run $(source).cpp : : : BOOST_TT_DISABLE_INTRINSICS : $(source)_no_intrinsics ] ;