diff --git a/include/boost/type_traits/common_type.hpp b/include/boost/type_traits/common_type.hpp index c887a89..7136d3e 100644 --- a/include/boost/type_traits/common_type.hpp +++ b/include/boost/type_traits/common_type.hpp @@ -13,6 +13,10 @@ #include #include #include +#include +#include +#include +#include #if defined(BOOST_NO_CXX11_DECLTYPE) #include @@ -75,6 +79,7 @@ struct common_type: common_type::type, T3, T4, T5, template struct common_type: boost::decay { + BOOST_STATIC_ASSERT_MSG(::boost::is_complete::value || ::boost::is_void::value || ::boost::is_array::value, "Arguments to common_type must both be complete types"); }; // two arguments @@ -138,6 +143,8 @@ template struct common_type_decay_helper: co template struct common_type: type_traits_detail::common_type_decay_helper { + BOOST_STATIC_ASSERT_MSG(::boost::is_complete::value || ::boost::is_void::value || ::boost::is_array::value, "Arguments to common_type must both be complete types"); + BOOST_STATIC_ASSERT_MSG(::boost::is_complete::value || ::boost::is_void::value || ::boost::is_array::value, "Arguments to common_type must both be complete types"); }; } // namespace boost diff --git a/include/boost/type_traits/has_nothrow_destructor.hpp b/include/boost/type_traits/has_nothrow_destructor.hpp index ba70e89..74dd9e7 100644 --- a/include/boost/type_traits/has_nothrow_destructor.hpp +++ b/include/boost/type_traits/has_nothrow_destructor.hpp @@ -15,6 +15,8 @@ #include #include +#include +#include namespace boost{ @@ -27,12 +29,19 @@ namespace boost{ } - template struct has_nothrow_destructor : public detail::has_nothrow_destructor_imp::value>{}; - template struct has_nothrow_destructor : public has_nothrow_destructor{}; + template struct has_nothrow_destructor : public detail::has_nothrow_destructor_imp::value> + { + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value, "Arguments to has_nothrow_destructor must be complete types"); + }; + template struct has_nothrow_destructor : public has_nothrow_destructor + { + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value, "Arguments to has_nothrow_destructor must be complete types"); + }; template struct has_nothrow_destructor : public integral_constant{}; #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template struct has_nothrow_destructor : public integral_constant{}; #endif + template <> struct has_nothrow_destructor : public false_type {}; } #else diff --git a/include/boost/type_traits/is_assignable.hpp b/include/boost/type_traits/is_assignable.hpp index 49d1716..6a9474b 100644 --- a/include/boost/type_traits/is_assignable.hpp +++ b/include/boost/type_traits/is_assignable.hpp @@ -12,6 +12,8 @@ #include // size_t #include #include +#include +#include namespace boost{ @@ -39,7 +41,10 @@ namespace boost{ } - template struct is_assignable : public integral_constant(0)) == sizeof(boost::type_traits::yes_type)>{}; + template struct is_assignable : public integral_constant(0)) == sizeof(boost::type_traits::yes_type)> + { + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value, "Arguments to is_assignable must be complete types"); + }; template struct is_assignable : public is_assignable{}; template struct is_assignable : public is_assignable{}; template struct is_assignable : public is_assignable{}; @@ -57,7 +62,10 @@ namespace boost{ namespace boost{ // We don't know how to implement this: - template struct is_assignable : public integral_constant{}; + template struct is_assignable : public integral_constant + { + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value, "Arguments to is_assignable must be complete types"); + }; template struct is_assignable : public integral_constant::value && is_pod::type>::value>{}; template struct is_assignable : public integral_constant{}; template struct is_assignable : public integral_constant{}; diff --git a/include/boost/type_traits/is_complete.hpp b/include/boost/type_traits/is_complete.hpp new file mode 100644 index 0000000..0de36a9 --- /dev/null +++ b/include/boost/type_traits/is_complete.hpp @@ -0,0 +1,81 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). +// +// See http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_IS_COMPLETE_HPP_INCLUDED +#define BOOST_TT_IS_COMPLETE_HPP_INCLUDED + +#include +#include +#include + +/* + * CAUTION: + * ~~~~~~~~ + * + * THIS TRAIT EXISTS SOLELY TO GENERATE HARD ERRORS WHEN A ANOTHER TRAIT + * WHICH REQUIRES COMPLETE TYPES AS ARGUMENTS IS PASSED AN INCOMPLETE TYPE + * + * DO NOT MAKE GENERAL USE OF THIS TRAIT, AS THE COMPLETENESS OF A TYPE + * VARIES ACROSS TRANSLATION UNITS AS WELL AS WITHIN A SINGLE UNIT. + * +*/ + +namespace boost { + +#ifndef BOOST_NO_SFINAE_EXPR + + namespace detail{ + + template + struct ok_tag { double d; char c[N]; }; + + template + ok_tag check_is_complete(int); + template + char check_is_complete(...); + } + + template struct is_complete + : public integral_constant::type>::value || (sizeof(detail::check_is_complete(0)) != sizeof(char))> {}; + +#elif !defined(BOOST_NO_SFINAE) + + namespace detail + { + + template + struct is_complete_imp + { + template ())) > + static type_traits::yes_type check(U*); + + template + static type_traits::no_type check(...); + + static const bool value = sizeof(check(0)) == sizeof(type_traits::yes_type); + }; + +} // namespace detail + + + template + struct is_complete : std::integral_constant::type>::value || detail::is_complete_imp::value> + {}; + template + struct is_complete : is_complete {}; + +#else + + template struct is_complete + : public integral_constant {}; + +#endif + +} // namespace boost + +#endif // BOOST_TT_IS_COMPLETE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_constructible.hpp b/include/boost/type_traits/is_constructible.hpp index 0c3b5c8..da62599 100644 --- a/include/boost/type_traits/is_constructible.hpp +++ b/include/boost/type_traits/is_constructible.hpp @@ -18,6 +18,8 @@ #include #include #include +#include +#include #define BOOST_TT_IS_CONSTRUCTIBLE_CONFORMING 1 @@ -45,8 +47,14 @@ 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(0)) == sizeof(boost::type_traits::yes_type)> + { + BOOST_STATIC_ASSERT_MSG(::boost::is_complete::value, "The target type must be complete in order to test for constructibility"); + }; + template struct is_constructible : public integral_constant::value && sizeof(detail::is_constructible_imp::test1(0)) == sizeof(boost::type_traits::yes_type)> + { + BOOST_STATIC_ASSERT_MSG(::boost::is_complete::value, "The target type must be complete in order to test for constructibility"); + }; 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)>{}; diff --git a/include/boost/type_traits/is_convertible.hpp b/include/boost/type_traits/is_convertible.hpp index 417ece2..991cdfd 100644 --- a/include/boost/type_traits/is_convertible.hpp +++ b/include/boost/type_traits/is_convertible.hpp @@ -15,6 +15,10 @@ #include #include #ifndef BOOST_IS_CONVERTIBLE +#include +#include +#include +#include #include #include #include @@ -474,7 +478,11 @@ template struct is_convertible_impl_dispatch : } // namespace detail template -struct is_convertible : public integral_constant::value> {}; +struct is_convertible : public integral_constant::value> +{ + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value || boost::is_void::value || boost::is_array::value, "Destination argument type to is_convertible must be a complete type"); + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value || boost::is_void::value || boost::is_array::value, "From argument type to is_convertible must be a complete type"); +}; #else diff --git a/include/boost/type_traits/is_default_constructible.hpp b/include/boost/type_traits/is_default_constructible.hpp index dc8ea13..9a4a0a7 100644 --- a/include/boost/type_traits/is_default_constructible.hpp +++ b/include/boost/type_traits/is_default_constructible.hpp @@ -12,6 +12,8 @@ #include // size_t #include #include +#include +#include #if BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700) #include @@ -51,9 +53,15 @@ namespace boost{ } #if BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700) - template struct is_default_constructible : public integral_constant::value>::value>{}; + template struct is_default_constructible : public integral_constant::value>::value> + { + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value, "Arguments to is_default_constructible must be complete types"); + }; #else - template struct is_default_constructible : public integral_constant(0)) == sizeof(boost::type_traits::yes_type)>{}; + template struct is_default_constructible : public integral_constant(0)) == sizeof(boost::type_traits::yes_type)> + { + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value, "Arguments to is_default_constructible must be complete types"); + }; #endif template struct is_default_constructible : public is_default_constructible{}; template struct is_default_constructible : public is_default_constructible{}; diff --git a/include/boost/type_traits/is_destructible.hpp b/include/boost/type_traits/is_destructible.hpp index 742d990..cc72fb7 100644 --- a/include/boost/type_traits/is_destructible.hpp +++ b/include/boost/type_traits/is_destructible.hpp @@ -12,6 +12,8 @@ #include // size_t #include #include +#include +#include #if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) @@ -32,7 +34,10 @@ namespace boost{ } - template struct is_destructible : public integral_constant(0)) == sizeof(boost::type_traits::yes_type)>{}; + template struct is_destructible : public integral_constant(0)) == sizeof(boost::type_traits::yes_type)> + { + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value, "Arguments to is_destructible must be complete types"); + }; #else @@ -42,7 +47,10 @@ namespace boost{ namespace boost{ // We don't know how to implement this: - template struct is_destructible : public integral_constant::value || is_class::value>{}; + template struct is_destructible : public integral_constant::value || is_class::value> + { + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value, "Arguments to is_destructible must be complete types"); + }; #endif template <> struct is_destructible : public false_type{}; diff --git a/include/boost/type_traits/is_list_constructible.hpp b/include/boost/type_traits/is_list_constructible.hpp index 518a75b..a47fac1 100644 --- a/include/boost/type_traits/is_list_constructible.hpp +++ b/include/boost/type_traits/is_list_constructible.hpp @@ -10,6 +10,8 @@ #include #include #include +#include +#include namespace boost { @@ -18,6 +20,7 @@ namespace boost template struct is_list_constructible: false_type { + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value, "Arguments to is_list_constructible must be complete types"); }; #else @@ -32,6 +35,7 @@ template false_type is_list_constructible_impl( ... ); template struct is_list_constructible: decltype( type_traits_detail::is_list_constructible_impl(0) ) { + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value, "Arguments to is_list_constructible must be complete types"); }; #endif diff --git a/include/boost/type_traits/is_nothrow_move_assignable.hpp b/include/boost/type_traits/is_nothrow_move_assignable.hpp index 4fb5bd8..5f63cb7 100644 --- a/include/boost/type_traits/is_nothrow_move_assignable.hpp +++ b/include/boost/type_traits/is_nothrow_move_assignable.hpp @@ -18,13 +18,18 @@ #include #include #include +#include +#include namespace boost { #ifdef BOOST_IS_NOTHROW_MOVE_ASSIGN template -struct is_nothrow_move_assignable : public integral_constant{}; +struct is_nothrow_move_assignable : public integral_constant +{ + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value, "Arguments to is_nothrow_move_assignable must be complete types"); +}; template struct is_nothrow_move_assignable : public false_type{}; template struct is_nothrow_move_assignable : public false_type{}; template struct is_nothrow_move_assignable : public false_type{}; @@ -50,7 +55,10 @@ struct false_or_cpp11_noexcept_move_assignable < } template -struct is_nothrow_move_assignable : public integral_constant::value>{}; +struct is_nothrow_move_assignable : public integral_constant::value> +{ + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value, "Arguments to is_nothrow_move_assignable must be complete types"); +}; template struct is_nothrow_move_assignable : public ::boost::false_type {}; template struct is_nothrow_move_assignable : public ::boost::false_type{}; @@ -64,7 +72,10 @@ template struct is_nothrow_move_assignable : public ::boost::fals template struct is_nothrow_move_assignable : public integral_constant::value || ::boost::has_nothrow_assign::value) && ! ::boost::is_array::value>{}; + (::boost::has_trivial_move_assign::value || ::boost::has_nothrow_assign::value) && ! ::boost::is_array::value> +{ + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value, "Arguments to is_nothrow_move_assignable must be complete types"); +}; #endif diff --git a/include/boost/type_traits/is_nothrow_move_constructible.hpp b/include/boost/type_traits/is_nothrow_move_constructible.hpp index 0d5d57a..6aaef51 100644 --- a/include/boost/type_traits/is_nothrow_move_constructible.hpp +++ b/include/boost/type_traits/is_nothrow_move_constructible.hpp @@ -16,13 +16,18 @@ #include #include #include +#include +#include #ifdef BOOST_IS_NOTHROW_MOVE_CONSTRUCT namespace boost { template -struct is_nothrow_move_constructible : public integral_constant{}; +struct is_nothrow_move_constructible : public integral_constant +{ + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value, "Arguments to is_nothrow_move_constructible must be complete types"); +}; template struct is_nothrow_move_constructible : public ::boost::false_type {}; template struct is_nothrow_move_constructible : public ::boost::false_type{}; @@ -47,7 +52,10 @@ struct false_or_cpp11_noexcept_move_constructible < } template struct is_nothrow_move_constructible - : public integral_constant::value>{}; + : public integral_constant::value> +{ + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value, "Arguments to is_nothrow_move_constructible must be complete types"); +}; template struct is_nothrow_move_constructible : public ::boost::false_type {}; template struct is_nothrow_move_constructible : public ::boost::false_type{}; @@ -66,7 +74,9 @@ template struct is_nothrow_move_constructible : public integral_constant::value || ::boost::has_nothrow_copy::value) && !::boost::is_array::value> -{}; +{ + BOOST_STATIC_ASSERT_MSG(boost::is_complete::value, "Arguments to is_nothrow_move_constructible must be complete types"); +}; #endif diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 2e35876..e58b1f1 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -39,6 +39,10 @@ rule all-tests { { result += [ run $(source) ] ; } + for local source in [ glob compile_fail/*.cpp ] + { + result += [ compile-fail $(source) ] ; + } # # These traits have both intrinsic support, and a std conforming version, test a version with intrinsics disabled for better code coverage: # diff --git a/test/compile_fail/common_type2_fail.cpp b/test/compile_fail/common_type2_fail.cpp new file mode 100644 index 0000000..a4b3db4 --- /dev/null +++ b/test/compile_fail/common_type2_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return sizeof(boost::common_type::type); +} + + diff --git a/test/compile_fail/common_type_fail.cpp b/test/compile_fail/common_type_fail.cpp new file mode 100644 index 0000000..7594811 --- /dev/null +++ b/test/compile_fail/common_type_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return sizeof(boost::common_type::type); +} + + diff --git a/test/compile_fail/has_nothrow_assign_fail.cpp b/test/compile_fail/has_nothrow_assign_fail.cpp new file mode 100644 index 0000000..3196d3a --- /dev/null +++ b/test/compile_fail/has_nothrow_assign_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::has_nothrow_assign::value; +} + + diff --git a/test/compile_fail/has_nothrow_cons_fail.cpp b/test/compile_fail/has_nothrow_cons_fail.cpp new file mode 100644 index 0000000..8512e5d --- /dev/null +++ b/test/compile_fail/has_nothrow_cons_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::has_nothrow_constructor::value; +} + + diff --git a/test/compile_fail/has_nothrow_copy_fail.cpp b/test/compile_fail/has_nothrow_copy_fail.cpp new file mode 100644 index 0000000..997a48a --- /dev/null +++ b/test/compile_fail/has_nothrow_copy_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::has_nothrow_copy::value; +} + + diff --git a/test/compile_fail/has_nothrow_destruct_fail.cpp b/test/compile_fail/has_nothrow_destruct_fail.cpp new file mode 100644 index 0000000..1b0d5a0 --- /dev/null +++ b/test/compile_fail/has_nothrow_destruct_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::has_nothrow_destructor::value; +} + + diff --git a/test/compile_fail/is_assignable_fail.cpp b/test/compile_fail/is_assignable_fail.cpp new file mode 100644 index 0000000..b745443 --- /dev/null +++ b/test/compile_fail/is_assignable_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::is_assignable::value; +} + + diff --git a/test/compile_fail/is_base_of_fail.cpp b/test/compile_fail/is_base_of_fail.cpp new file mode 100644 index 0000000..cff40b2 --- /dev/null +++ b/test/compile_fail/is_base_of_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::is_base_of::value; +} + + diff --git a/test/compile_fail/is_constructible_fail.cpp b/test/compile_fail/is_constructible_fail.cpp new file mode 100644 index 0000000..926b43c --- /dev/null +++ b/test/compile_fail/is_constructible_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::is_constructible::value; +} + + diff --git a/test/compile_fail/is_convertible2_fail.cpp b/test/compile_fail/is_convertible2_fail.cpp new file mode 100644 index 0000000..0afd996 --- /dev/null +++ b/test/compile_fail/is_convertible2_fail.cpp @@ -0,0 +1,19 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +#if defined(CI_SUPPRESS_KNOWN_ISSUES) && defined(BOOST_MSVC) && (BOOST_MSVC <= 1800) +#error "Sorry check doesn't work" +#endif + +int main() +{ + return boost::is_convertible::value; +} + + diff --git a/test/compile_fail/is_convertible_fail.cpp b/test/compile_fail/is_convertible_fail.cpp new file mode 100644 index 0000000..792c442 --- /dev/null +++ b/test/compile_fail/is_convertible_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::is_convertible::value; +} + + diff --git a/test/compile_fail/is_copy_assignable_fail.cpp b/test/compile_fail/is_copy_assignable_fail.cpp new file mode 100644 index 0000000..f8c512e --- /dev/null +++ b/test/compile_fail/is_copy_assignable_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::is_copy_assignable::value; +} + + diff --git a/test/compile_fail/is_copy_constructible_fail.cpp b/test/compile_fail/is_copy_constructible_fail.cpp new file mode 100644 index 0000000..8ab35da --- /dev/null +++ b/test/compile_fail/is_copy_constructible_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::is_copy_constructible::value; +} + + diff --git a/test/compile_fail/is_default_constructible_fail.cpp b/test/compile_fail/is_default_constructible_fail.cpp new file mode 100644 index 0000000..78381b3 --- /dev/null +++ b/test/compile_fail/is_default_constructible_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::is_default_constructible::value; +} + + diff --git a/test/compile_fail/is_destructible_fail.cpp b/test/compile_fail/is_destructible_fail.cpp new file mode 100644 index 0000000..33dea9b --- /dev/null +++ b/test/compile_fail/is_destructible_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::is_destructible::value; +} + + diff --git a/test/compile_fail/is_empty_fail.cpp b/test/compile_fail/is_empty_fail.cpp new file mode 100644 index 0000000..ef3d171 --- /dev/null +++ b/test/compile_fail/is_empty_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::is_empty::value; +} + + diff --git a/test/compile_fail/is_list_constructible_fail.cpp b/test/compile_fail/is_list_constructible_fail.cpp new file mode 100644 index 0000000..429f8de --- /dev/null +++ b/test/compile_fail/is_list_constructible_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::is_list_constructible::value; +} + + diff --git a/test/compile_fail/is_nothrow_move_assignable_fail.cpp b/test/compile_fail/is_nothrow_move_assignable_fail.cpp new file mode 100644 index 0000000..5cb5f54 --- /dev/null +++ b/test/compile_fail/is_nothrow_move_assignable_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::is_nothrow_move_assignable::value; +} + + diff --git a/test/compile_fail/is_nothrow_move_constructible_fail.cpp b/test/compile_fail/is_nothrow_move_constructible_fail.cpp new file mode 100644 index 0000000..54d1329 --- /dev/null +++ b/test/compile_fail/is_nothrow_move_constructible_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::is_nothrow_move_constructible::value; +} + + diff --git a/test/compile_fail/is_polymorphic_fail.cpp b/test/compile_fail/is_polymorphic_fail.cpp new file mode 100644 index 0000000..d182519 --- /dev/null +++ b/test/compile_fail/is_polymorphic_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::is_polymorphic::value; +} + + diff --git a/test/compile_fail/is_stateless_fail.cpp b/test/compile_fail/is_stateless_fail.cpp new file mode 100644 index 0000000..2a8b4aa --- /dev/null +++ b/test/compile_fail/is_stateless_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::is_stateless::value; +} + + diff --git a/test/compile_fail/is_virtual_base_of_fail.cpp b/test/compile_fail/is_virtual_base_of_fail.cpp new file mode 100644 index 0000000..a8ca79e --- /dev/null +++ b/test/compile_fail/is_virtual_base_of_fail.cpp @@ -0,0 +1,15 @@ + +// (C) Copyright John Maddock 2017. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +# include +#include "../test.hpp" + +int main() +{ + return boost::is_virtual_base_of::value; +} + + diff --git a/test/is_complete_test.cpp b/test/is_complete_test.cpp new file mode 100644 index 0000000..b981f18 --- /dev/null +++ b/test/is_complete_test.cpp @@ -0,0 +1,55 @@ + +// (C) Copyright John Maddock 2000. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifdef TEST_STD +# include +#else +# include +#endif +#include "test.hpp" +#include "check_integral_constant.hpp" + +TT_TEST_BEGIN(is_complete) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +#ifndef BOOST_NO_SFINAE +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +#ifndef BOOST_NO_SFINAE +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complete::value, true); + +TT_TEST_END +