// (C) Copyright John Maddock 2000. // (C) Copyright Antony Polukhin 2013. // 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 "test.hpp" #include #if !(defined(BOOST_MSVC) && defined(BOOST_TT_DISABLE_INTRINSICS) && defined(CI_SUPPRESS_KNOWN_ISSUES)) #include "check_integral_constant.hpp" #ifdef TEST_STD # include #else # include #endif struct non_copy { non_copy(); private: non_copy(const non_copy&); }; #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS struct delete_copy { delete_copy(); delete_copy(const delete_copy&) = delete; }; #endif #ifndef BOOST_NO_CXX11_NOEXCEPT struct noexcept_copy { noexcept_copy(); noexcept_copy(const noexcept_copy&)noexcept; }; struct noexcept_move { noexcept_move(); noexcept_move(const noexcept_move&); noexcept_move(noexcept_move&&)noexcept; }; #endif TT_TEST_BEGIN(is_nothrow_move_constructible) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); #ifndef TEST_STD // unspecified behaviour: BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); #ifndef TEST_STD // unspecified behaviour: BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); #ifndef TEST_STD // unspecified behaviour: BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); #ifndef TEST_STD // unspecified behaviour: BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); #ifndef TEST_STD // unspecified behaviour: BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); #ifndef TEST_STD // unspecified behaviour: BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); #endif #ifdef BOOST_HAS_LONG_LONG BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible< ::boost::ulong_long_type>::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible< ::boost::long_long_type>::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible< ::boost::ulong_long_type const>::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible< ::boost::long_long_type const>::value, true); #ifndef TEST_STD // unspecified behaviour: BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible< ::boost::ulong_long_type volatile>::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible< ::boost::long_long_type volatile>::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible< ::boost::ulong_long_type const volatile>::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible< ::boost::long_long_type const volatile>::value, false); #endif #endif #ifdef BOOST_HAS_MS_INT64 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<__int8>::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<__int8 const>::value, true); #ifndef TEST_STD // unspecified behaviour: BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<__int8 volatile>::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<__int8 const volatile>::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<__int16>::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<__int16 const>::value, true); #ifndef TEST_STD // unspecified behaviour: BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<__int16 volatile>::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<__int16 const volatile>::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<__int32>::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<__int32 const>::value, true); #ifndef TEST_STD // unspecified behaviour: BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<__int32 volatile>::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<__int32 const volatile>::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<__int64>::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<__int64 const>::value, true); #ifndef TEST_STD // unspecified behaviour: BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<__int64 volatile>::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<__int64 const volatile>::value, false); #endif #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); #ifndef TEST_STD // unspecified behaviour: BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); #ifndef TEST_STD // unspecified behaviour: BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); #ifndef TEST_STD // unspecified behaviour: BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); #if (!defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR)) || defined(BOOST_IS_NOTHROW_MOVE_CONSTRUCT) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); #if !defined(BOOST_GCC) || (BOOST_GCC >= 40800) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); #endif #else // cases we would like to succeed but can't implement in the language: BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); #if !defined(BOOST_GCC) || (BOOST_GCC >= 40700) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); #endif #if !defined(BOOST_GCC) || (BOOST_GCC >= 40800) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); #endif #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); #endif #if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); #if !defined(BOOST_GCC) || (BOOST_GCC >= 40800) // Test fails on gcc 4.7.x: BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); #endif #endif TT_TEST_END #else int main() { return 0; } #endif