Ticket #8189: type_traits.patch
File type_traits.patch, 68.5 KB (added by , 10 years ago) |
---|
-
boost/type_traits/intrinsics.hpp
24 24 // BOOST_IS_EMPTY(T) should evaluate to true if T is an empty class type (and not a union) 25 25 // BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) should evaluate to true if "T x;" has no effect 26 26 // BOOST_HAS_TRIVIAL_COPY(T) should evaluate to true if T(t) <==> memcpy 27 // BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) should evaluate to true if T(boost::move(t)) <==> memcpy 27 28 // BOOST_HAS_TRIVIAL_ASSIGN(T) should evaluate to true if t = u <==> memcpy 29 // BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) should evaluate to true if t = boost::move(u) <==> memcpy 28 30 // BOOST_HAS_TRIVIAL_DESTRUCTOR(T) should evaluate to true if ~T() has no effect 29 31 // BOOST_HAS_NOTHROW_CONSTRUCTOR(T) should evaluate to true if "T x;" can not throw 30 32 // BOOST_HAS_NOTHROW_COPY(T) should evaluate to true if T(t) can not throw -
boost/type_traits/has_nothrow_move_assign.hpp
1 2 // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. 3 // (C) Copyright Eric Friedman 2002-2003. 4 // (C) Copyright Antony Polukhin 2013. 5 // Use, modification and distribution are subject to the Boost Software License, 6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 7 // http://www.boost.org/LICENSE_1_0.txt). 8 // 9 // See http://www.boost.org/libs/type_traits for most recent version including documentation. 10 11 #ifndef BOOST_TT_HAS_NOTHROW_MOVE_ASSIGN_HPP_INCLUDED 12 #define BOOST_TT_HAS_NOTHROW_MOVE_ASSIGN_HPP_INCLUDED 13 14 #include <boost/config.hpp> 15 #include <boost/type_traits/has_trivial_move_assign.hpp> 16 #include <boost/type_traits/has_nothrow_assign.hpp> 17 18 // should be the last #include 19 #include <boost/type_traits/detail/bool_trait_def.hpp> 20 21 namespace boost { 22 23 namespace detail{ 24 25 template <class T> 26 struct has_nothrow_move_assign_imp{ 27 #ifndef BOOST_NO_CXX11_NOEXCEPT 28 BOOST_STATIC_CONSTANT(bool, value = ( 29 ::boost::type_traits::ice_or< 30 ::boost::has_trivial_move_assign<T>::value, 31 BOOST_NOEXCEPT_EXPR(::boost::declval<T>() = ::boost::declval<T>()) 32 >::value)); 33 #else 34 BOOST_STATIC_CONSTANT(bool, value = ( 35 ::boost::type_traits::ice_or< 36 ::boost::has_trivial_move_assign<T>::value, 37 ::boost::has_nothrow_assign<T>::value 38 >::value)); 39 #endif 40 }; 41 42 } 43 44 BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_move_assign,T,::boost::detail::has_nothrow_move_assign_imp<T>::value) 45 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_move_assign,void,false) 46 #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS 47 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_move_assign,void const,false) 48 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_move_assign,void const volatile,false) 49 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_move_assign,void volatile,false) 50 #endif 51 52 } // namespace boost 53 54 #include <boost/type_traits/detail/bool_trait_undef.hpp> 55 56 #endif // BOOST_TT_HAS_NOTHROW_MOVE_ASSIGN_HPP_INCLUDED -
boost/type_traits/has_trivial_move_assign.hpp
Property changes on: boost/type_traits/has_nothrow_move_assign.hpp ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property
1 2 // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. 3 // (C) Copyright Eric Friedman 2002-2003. 4 // (C) Copyright Antony Polukhin 2013. 5 // Use, modification and distribution are subject to the Boost Software License, 6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 7 // http://www.boost.org/LICENSE_1_0.txt). 8 // 9 // See http://www.boost.org/libs/type_traits for most recent version including documentation. 10 11 #ifndef BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED 12 #define BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED 13 14 #include <boost/type_traits/config.hpp> 15 #include <boost/type_traits/is_pod.hpp> 16 #include <boost/type_traits/has_trivial_assign.hpp> 17 #include <boost/type_traits/detail/ice_or.hpp> 18 19 // should be the last #include 20 #include <boost/type_traits/detail/bool_trait_def.hpp> 21 22 namespace boost { 23 24 namespace detail { 25 26 template <typename T> 27 struct has_trivial_move_assign_impl 28 { 29 #ifdef BOOST_HAS_TRIVIAL_MOVE_ASSIGN 30 BOOST_STATIC_CONSTANT(bool, value = (BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T))); 31 #else 32 BOOST_STATIC_CONSTANT(bool, value = (::boost::has_trivial_assign<T>::value)); 33 #endif 34 }; 35 36 } // namespace detail 37 38 BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_move_assign,T,::boost::detail::has_trivial_move_assign_impl<T>::value) 39 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void,false) 40 #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS 41 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void const,false) 42 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void const volatile,false) 43 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void volatile,false) 44 #endif 45 46 } // namespace boost 47 48 #include <boost/type_traits/detail/bool_trait_undef.hpp> 49 50 #endif // BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED -
boost/type_traits/has_nothrow_move_constructor.hpp
Property changes on: boost/type_traits/has_trivial_move_assign.hpp ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property
1 2 // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. 3 // (C) Copyright Eric Friedman 2002-2003. 4 // (C) Copyright Antony Polukhin 2013. 5 // Use, modification and distribution are subject to the Boost Software License, 6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 7 // http://www.boost.org/LICENSE_1_0.txt). 8 // 9 // See http://www.boost.org/libs/type_traits for most recent version including documentation. 10 11 #ifndef BOOST_TT_HAS_NOTHROW_MOVE_CONSTRUCTOR_HPP_INCLUDED 12 #define BOOST_TT_HAS_NOTHROW_MOVE_CONSTRUCTOR_HPP_INCLUDED 13 14 #include <boost/config.hpp> 15 #include <boost/type_traits/has_trivial_move_constructor.hpp> 16 #include <boost/type_traits/has_nothrow_copy.hpp> 17 #include <boost/type_traits/detail/ice_or.hpp> 18 #include <boost/utility/declval.hpp> 19 20 // should be the last #include 21 #include <boost/type_traits/detail/bool_trait_def.hpp> 22 23 namespace boost { 24 25 namespace detail{ 26 27 template <class T> 28 struct has_nothrow_move_constructor_imp{ 29 #ifndef BOOST_NO_CXX11_NOEXCEPT 30 BOOST_STATIC_CONSTANT(bool, value = 31 (::boost::type_traits::ice_or< 32 ::boost::has_trivial_move_constructor<T>::value, 33 BOOST_NOEXCEPT_EXPR(T(::boost::declval<T>())) 34 >::value)); 35 #else 36 BOOST_STATIC_CONSTANT(bool, value = 37 (::boost::type_traits::ice_or< 38 ::boost::has_trivial_move_constructor<T>::value, 39 ::boost::has_nothrow_copy<T>::value 40 >::value)); 41 #endif 42 }; 43 44 } 45 46 BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_move_constructor,T,::boost::detail::has_nothrow_move_constructor_imp<T>::value) 47 48 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_move_constructor,void,false) 49 #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS 50 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_move_constructor,void const,false) 51 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_move_constructor,void const volatile,false) 52 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_move_constructor,void volatile,false) 53 #endif 54 55 } // namespace boost 56 57 #include <boost/type_traits/detail/bool_trait_undef.hpp> 58 59 #endif // BOOST_TT_HAS_NOTHROW_MOVE_CONSTRUCTOR_HPP_INCLUDED -
boost/type_traits/has_trivial_move_constructor.hpp
Property changes on: boost/type_traits/has_nothrow_move_constructor.hpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property
1 2 // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. 3 // (C) Copyright Eric Friedman 2002-2003. 4 // (C) Copyright Antony Polukhin 2013. 5 // Use, modification and distribution are subject to the Boost Software License, 6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 7 // http://www.boost.org/LICENSE_1_0.txt). 8 // 9 // See http://www.boost.org/libs/type_traits for most recent version including documentation. 10 11 #ifndef BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_HPP_INCLUDED 12 #define BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_HPP_INCLUDED 13 14 #include <boost/type_traits/config.hpp> 15 #include <boost/type_traits/intrinsics.hpp> 16 #include <boost/type_traits/is_pod.hpp> 17 #include "boost/type_traits/has_trivial_copy.hpp" 18 #include <boost/type_traits/detail/ice_or.hpp> 19 20 // should be the last #include 21 #include <boost/type_traits/detail/bool_trait_def.hpp> 22 23 namespace boost { 24 25 namespace detail { 26 27 template <typename T> 28 struct has_trivial_move_ctor_impl 29 { 30 #ifdef BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR 31 BOOST_STATIC_CONSTANT(bool, value = (BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T))); 32 #else 33 BOOST_STATIC_CONSTANT(bool, value = (::boost::has_trivial_copy<T>::value)); 34 #endif 35 }; 36 37 } // namespace detail 38 39 BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_move_constructor,T,::boost::detail::has_trivial_move_ctor_impl<T>::value) 40 41 } // namespace boost 42 43 #include <boost/type_traits/detail/bool_trait_undef.hpp> 44 45 #endif // BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_HPP_INCLUDED -
libs/type_traits/test/has_trivial_move_constructor_test.cpp
Property changes on: boost/type_traits/has_trivial_move_constructor.hpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property
1 2 // (C) Copyright John Maddock 2000. 3 // (C) Copyright Antony Polukhin 2013. 4 // Use, modification and distribution are subject to the 5 // Boost Software License, Version 1.0. (See accompanying file 6 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 8 #include "test.hpp" 9 #include "check_integral_constant.hpp" 10 #ifdef TEST_STD 11 # include <type_traits> 12 #else 13 # include <boost/type_traits/has_trivial_move_constructor.hpp> 14 #endif 15 16 TT_TEST_BEGIN(has_trivial_move_constructor) 17 18 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<bool>::value, true); 19 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<bool const>::value, true); 20 #ifndef TEST_STD 21 // unspecified behaviour: 22 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<bool volatile>::value, false); 23 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<bool const volatile>::value, false); 24 #endif 25 26 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<signed char>::value, true); 27 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<signed char const>::value, true); 28 #ifndef TEST_STD 29 // unspecified behaviour: 30 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<signed char volatile>::value, false); 31 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<signed char const volatile>::value, false); 32 #endif 33 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned char>::value, true); 34 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<char>::value, true); 35 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned char const>::value, true); 36 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<char const>::value, true); 37 #ifndef TEST_STD 38 // unspecified behaviour: 39 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned char volatile>::value, false); 40 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<char volatile>::value, false); 41 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned char const volatile>::value, false); 42 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<char const volatile>::value, false); 43 #endif 44 45 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned short>::value, true); 46 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<short>::value, true); 47 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned short const>::value, true); 48 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<short const>::value, true); 49 #ifndef TEST_STD 50 // unspecified behaviour: 51 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned short volatile>::value, false); 52 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<short volatile>::value, false); 53 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned short const volatile>::value, false); 54 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<short const volatile>::value, false); 55 #endif 56 57 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned int>::value, true); 58 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int>::value, true); 59 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned int const>::value, true); 60 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int const>::value, true); 61 #ifndef TEST_STD 62 // unspecified behaviour: 63 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned int volatile>::value, false); 64 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int volatile>::value, false); 65 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned int const volatile>::value, false); 66 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int const volatile>::value, false); 67 #endif 68 69 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned long>::value, true); 70 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<long>::value, true); 71 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned long const>::value, true); 72 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<long const>::value, true); 73 #ifndef TEST_STD 74 // unspecified behaviour: 75 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned long volatile>::value, false); 76 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<long volatile>::value, false); 77 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned long const volatile>::value, false); 78 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<long const volatile>::value, false); 79 #endif 80 #ifdef BOOST_HAS_LONG_LONG 81 82 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::ulong_long_type>::value, true); 83 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::long_long_type>::value, true); 84 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::ulong_long_type const>::value, true); 85 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::long_long_type const>::value, true); 86 #ifndef TEST_STD 87 // unspecified behaviour: 88 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::ulong_long_type volatile>::value, false); 89 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::long_long_type volatile>::value, false); 90 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::ulong_long_type const volatile>::value, false); 91 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor< ::boost::long_long_type const volatile>::value, false); 92 #endif 93 #endif 94 95 #ifdef BOOST_HAS_MS_INT64 96 97 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int8>::value, true); 98 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int8>::value, true); 99 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int8 const>::value, true); 100 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int8 const>::value, true); 101 #ifndef TEST_STD 102 // unspecified behaviour: 103 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int8 volatile>::value, false); 104 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int8 volatile>::value, false); 105 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int8 const volatile>::value, false); 106 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int8 const volatile>::value, false); 107 #endif 108 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int16>::value, true); 109 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int16>::value, true); 110 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int16 const>::value, true); 111 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int16 const>::value, true); 112 #ifndef TEST_STD 113 // unspecified behaviour: 114 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int16 volatile>::value, false); 115 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int16 volatile>::value, false); 116 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int16 const volatile>::value, false); 117 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int16 const volatile>::value, false); 118 #endif 119 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int32>::value, true); 120 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int32>::value, true); 121 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int32 const>::value, true); 122 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int32 const>::value, true); 123 #ifndef TEST_STD 124 // unspecified behaviour: 125 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int32 volatile>::value, false); 126 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int32 volatile>::value, false); 127 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int32 const volatile>::value, false); 128 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int32 const volatile>::value, false); 129 #endif 130 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int64>::value, true); 131 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int64>::value, true); 132 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int64 const>::value, true); 133 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int64 const>::value, true); 134 #ifndef TEST_STD 135 // unspecified behaviour: 136 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int64 volatile>::value, false); 137 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int64 volatile>::value, false); 138 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<unsigned __int64 const volatile>::value, false); 139 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<__int64 const volatile>::value, false); 140 #endif 141 #endif 142 143 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<float>::value, true); 144 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<float const>::value, true); 145 #ifndef TEST_STD 146 // unspecified behaviour: 147 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<float volatile>::value, false); 148 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<float const volatile>::value, false); 149 #endif 150 151 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<double>::value, true); 152 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<double const>::value, true); 153 #ifndef TEST_STD 154 // unspecified behaviour: 155 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<double volatile>::value, false); 156 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<double const volatile>::value, false); 157 #endif 158 159 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<long double>::value, true); 160 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<long double const>::value, true); 161 #ifndef TEST_STD 162 // unspecified behaviour: 163 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<long double volatile>::value, false); 164 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<long double const volatile>::value, false); 165 #endif 166 167 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int>::value, true); 168 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<void*>::value, true); 169 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int*const>::value, true); 170 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<f1>::value, true); 171 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<f2>::value, true); 172 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<f3>::value, true); 173 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<mf1>::value, true); 174 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<mf2>::value, true); 175 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<mf3>::value, true); 176 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<mp>::value, true); 177 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<cmf>::value, true); 178 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<enum_UDT>::value, true); 179 180 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int&>::value, false); 181 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES 182 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int&&>::value, false); 183 #endif 184 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<const int&>::value, false); 185 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int[2]>::value, true); 186 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int[3][2]>::value, true); 187 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<int[2][4][5][6][3]>::value, true); 188 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<UDT>::value, false); 189 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<void>::value, false); 190 // cases we would like to succeed but can't implement in the language: 191 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<empty_POD_UDT>::value, true, false); 192 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<POD_UDT>::value, true, false); 193 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<POD_union_UDT>::value, true, false); 194 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<empty_POD_union_UDT>::value, true, false); 195 196 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<trivial_except_copy>::value, false); 197 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<trivial_except_destroy>::value, true, false); 198 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<trivial_except_construct>::value, true, false); 199 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<trivial_except_assign>::value, true, false); 200 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<wrap<trivial_except_copy> >::value, false); 201 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<wrap<trivial_except_destroy> >::value, true, false); 202 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<wrap<trivial_except_construct> >::value, true, false); 203 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<wrap<trivial_except_assign> >::value, true, false); 204 205 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor<test_abc1>::value, false); 206 207 TT_TEST_END 208 209 210 211 212 213 214 215 -
libs/type_traits/test/has_nothrow_move_assign_test.cpp
Property changes on: libs/type_traits/test/has_trivial_move_constructor_test.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property
1 2 // (C) Copyright John Maddock 2000. 3 // (C) Copyright Antony Polukhin 2013. 4 // Use, modification and distribution are subject to the 5 // Boost Software License, Version 1.0. (See accompanying file 6 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 8 #include "test.hpp" 9 #include "check_integral_constant.hpp" 10 #ifdef TEST_STD 11 # include <type_traits> 12 #else 13 # include <boost/type_traits/has_nothrow_move_assign.hpp> 14 #endif 15 16 TT_TEST_BEGIN(has_nothrow_move_assign) 17 18 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<bool>::value, true); 19 #ifndef TEST_STD 20 // unspecified behaviour: 21 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<bool const>::value, false); 22 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<bool volatile>::value, false); 23 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<bool const volatile>::value, false); 24 #endif 25 26 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<signed char>::value, true); 27 #ifndef TEST_STD 28 // unspecified behaviour: 29 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<signed char const>::value, false); 30 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<signed char volatile>::value, false); 31 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<signed char const volatile>::value, false); 32 #endif 33 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned char>::value, true); 34 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<char>::value, true); 35 #ifndef TEST_STD 36 // unspecified behaviour: 37 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned char const>::value, false); 38 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<char const>::value, false); 39 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned char volatile>::value, false); 40 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<char volatile>::value, false); 41 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned char const volatile>::value, false); 42 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<char const volatile>::value, false); 43 #endif 44 45 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned short>::value, true); 46 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<short>::value, true); 47 #ifndef TEST_STD 48 // unspecified behaviour: 49 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned short const>::value, false); 50 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<short const>::value, false); 51 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned short volatile>::value, false); 52 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<short volatile>::value, false); 53 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned short const volatile>::value, false); 54 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<short const volatile>::value, false); 55 #endif 56 57 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned int>::value, true); 58 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int>::value, true); 59 #ifndef TEST_STD 60 // unspecified behaviour: 61 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned int const>::value, false); 62 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int const>::value, false); 63 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned int volatile>::value, false); 64 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int volatile>::value, false); 65 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned int const volatile>::value, false); 66 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int const volatile>::value, false); 67 #endif 68 69 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned long>::value, true); 70 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<long>::value, true); 71 #ifndef TEST_STD 72 // unspecified behaviour: 73 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned long const>::value, false); 74 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<long const>::value, false); 75 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned long volatile>::value, false); 76 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<long volatile>::value, false); 77 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned long const volatile>::value, false); 78 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<long const volatile>::value, false); 79 #endif 80 81 #ifdef BOOST_HAS_LONG_LONG 82 83 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign< ::boost::ulong_long_type>::value, true); 84 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign< ::boost::long_long_type>::value, true); 85 #ifndef TEST_STD 86 // unspecified behaviour: 87 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign< ::boost::ulong_long_type const>::value, false); 88 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign< ::boost::long_long_type const>::value, false); 89 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign< ::boost::ulong_long_type volatile>::value, false); 90 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign< ::boost::long_long_type volatile>::value, false); 91 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign< ::boost::ulong_long_type const volatile>::value, false); 92 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign< ::boost::long_long_type const volatile>::value, false); 93 #endif 94 #endif 95 96 #ifdef BOOST_HAS_MS_INT64 97 98 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int8>::value, true); 99 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int8>::value, true); 100 #ifndef TEST_STD 101 // unspecified behaviour: 102 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int8 const>::value, false); 103 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int8 const>::value, false); 104 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int8 volatile>::value, false); 105 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int8 volatile>::value, false); 106 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int8 const volatile>::value, false); 107 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int8 const volatile>::value, false); 108 #endif 109 110 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int16>::value, true); 111 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int16>::value, true); 112 #ifndef TEST_STD 113 // unspecified behaviour: 114 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int16 const>::value, false); 115 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int16 const>::value, false); 116 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int16 volatile>::value, false); 117 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int16 volatile>::value, false); 118 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int16 const volatile>::value, false); 119 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int16 const volatile>::value, false); 120 #endif 121 122 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int32>::value, true); 123 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int32>::value, true); 124 #ifndef TEST_STD 125 // unspecified behaviour: 126 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int32 const>::value, false); 127 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int32 const>::value, false); 128 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int32 volatile>::value, false); 129 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int32 volatile>::value, false); 130 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int32 const volatile>::value, false); 131 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int32 const volatile>::value, false); 132 #endif 133 134 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int64>::value, true); 135 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int64>::value, true); 136 #ifndef TEST_STD 137 // unspecified behaviour: 138 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int64 const>::value, false); 139 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int64 const>::value, false); 140 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int64 volatile>::value, false); 141 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int64 volatile>::value, false); 142 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<unsigned __int64 const volatile>::value, false); 143 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<__int64 const volatile>::value, false); 144 #endif 145 #endif 146 147 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<float>::value, true); 148 #ifndef TEST_STD 149 // unspecified behaviour: 150 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<float const>::value, false); 151 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<float volatile>::value, false); 152 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<float const volatile>::value, false); 153 #endif 154 155 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<double>::value, true); 156 #ifndef TEST_STD 157 // unspecified behaviour: 158 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<double const>::value, false); 159 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<double volatile>::value, false); 160 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<double const volatile>::value, false); 161 #endif 162 163 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<long double>::value, true); 164 #ifndef TEST_STD 165 // unspecified behaviour: 166 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<long double const>::value, false); 167 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<long double volatile>::value, false); 168 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<long double const volatile>::value, false); 169 #endif 170 171 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int>::value, true); 172 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<void*>::value, true); 173 #ifndef TEST_STD 174 // unspecified behaviour: 175 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int*const>::value, false); 176 #endif 177 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<f1>::value, true); 178 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<f2>::value, true); 179 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<f3>::value, true); 180 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<mf1>::value, true); 181 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<mf2>::value, true); 182 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<mf3>::value, true); 183 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<mp>::value, true); 184 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<cmf>::value, true); 185 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<enum_UDT>::value, true); 186 187 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int&>::value, false); 188 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES 189 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int&&>::value, false); 190 #endif 191 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<const int&>::value, false); 192 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int[2]>::value, true); 193 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int[3][2]>::value, true); 194 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<int[2][4][5][6][3]>::value, true); 195 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<UDT>::value, false); 196 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<empty_UDT>::value, false); 197 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<void>::value, false); 198 // cases we would like to succeed but can't implement in the language: 199 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<empty_POD_UDT>::value, true, false); 200 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<POD_UDT>::value, true, false); 201 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<POD_union_UDT>::value, true, false); 202 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<empty_POD_union_UDT>::value, true, false); 203 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<nothrow_assign_UDT>::value, true, false); 204 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<nothrow_copy_UDT>::value, false); 205 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<nothrow_construct_UDT>::value, false); 206 207 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_assign<test_abc1>::value, false); 208 209 TT_TEST_END 210 211 212 -
libs/type_traits/test/has_trivial_move_assign_test.cpp
Property changes on: libs/type_traits/test/has_nothrow_move_assign_test.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property
1 2 // (C) Copyright John Maddock 2000. 3 // (C) Copyright Antony Polukhin 2013. 4 // Use, modification and distribution are subject to the 5 // Boost Software License, Version 1.0. (See accompanying file 6 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 8 #include "test.hpp" 9 #include "check_integral_constant.hpp" 10 #ifdef TEST_STD 11 # include <type_traits> 12 #else 13 # include <boost/type_traits/has_trivial_move_assign.hpp> 14 #endif 15 16 TT_TEST_BEGIN(has_trivial_move_assign) 17 18 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<bool>::value, true); 19 #ifndef TEST_STD 20 // unspecified behaviour: 21 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<bool const>::value, false); 22 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<bool volatile>::value, false); 23 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<bool const volatile>::value, false); 24 #endif 25 26 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<signed char>::value, true); 27 #ifndef TEST_STD 28 // unspecified behaviour: 29 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<signed char const>::value, false); 30 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<signed char volatile>::value, false); 31 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<signed char const volatile>::value, false); 32 #endif 33 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned char>::value, true); 34 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<char>::value, true); 35 #ifndef TEST_STD 36 // unspecified behaviour: 37 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned char const>::value, false); 38 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<char const>::value, false); 39 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned char volatile>::value, false); 40 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<char volatile>::value, false); 41 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned char const volatile>::value, false); 42 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<char const volatile>::value, false); 43 #endif 44 45 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned short>::value, true); 46 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<short>::value, true); 47 #ifndef TEST_STD 48 // unspecified behaviour: 49 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned short const>::value, false); 50 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<short const>::value, false); 51 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned short volatile>::value, false); 52 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<short volatile>::value, false); 53 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned short const volatile>::value, false); 54 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<short const volatile>::value, false); 55 #endif 56 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned int>::value, true); 57 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int>::value, true); 58 #ifndef TEST_STD 59 // unspecified behaviour: 60 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned int const>::value, false); 61 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int const>::value, false); 62 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned int volatile>::value, false); 63 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int volatile>::value, false); 64 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned int const volatile>::value, false); 65 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int const volatile>::value, false); 66 #endif 67 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned long>::value, true); 68 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<long>::value, true); 69 #ifndef TEST_STD 70 // unspecified behaviour: 71 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned long const>::value, false); 72 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<long const>::value, false); 73 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned long volatile>::value, false); 74 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<long volatile>::value, false); 75 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned long const volatile>::value, false); 76 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<long const volatile>::value, false); 77 #endif 78 #ifdef BOOST_HAS_LONG_LONG 79 80 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::ulong_long_type>::value, true); 81 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::long_long_type>::value, true); 82 #ifndef TEST_STD 83 // unspecified behaviour: 84 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::ulong_long_type const>::value, false); 85 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::long_long_type const>::value, false); 86 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::ulong_long_type volatile>::value, false); 87 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::long_long_type volatile>::value, false); 88 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::ulong_long_type const volatile>::value, false); 89 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign< ::boost::long_long_type const volatile>::value, false); 90 #endif 91 #endif 92 93 #ifdef BOOST_HAS_MS_INT64 94 95 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int8>::value, true); 96 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int8>::value, true); 97 #ifndef TEST_STD 98 // unspecified behaviour: 99 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int8 const>::value, false); 100 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int8 const>::value, false); 101 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int8 volatile>::value, false); 102 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int8 volatile>::value, false); 103 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int8 const volatile>::value, false); 104 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int8 const volatile>::value, false); 105 #endif 106 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int16>::value, true); 107 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int16>::value, true); 108 #ifndef TEST_STD 109 // unspecified behaviour: 110 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int16 const>::value, false); 111 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int16 const>::value, false); 112 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int16 volatile>::value, false); 113 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int16 volatile>::value, false); 114 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int16 const volatile>::value, false); 115 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int16 const volatile>::value, false); 116 #endif 117 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int32>::value, true); 118 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int32>::value, true); 119 #ifndef TEST_STD 120 // unspecified behaviour: 121 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int32 const>::value, false); 122 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int32 const>::value, false); 123 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int32 volatile>::value, false); 124 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int32 volatile>::value, false); 125 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int32 const volatile>::value, false); 126 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int32 const volatile>::value, false); 127 #endif 128 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int64>::value, true); 129 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int64>::value, true); 130 #ifndef TEST_STD 131 // unspecified behaviour: 132 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int64 const>::value, false); 133 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int64 const>::value, false); 134 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int64 volatile>::value, false); 135 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int64 volatile>::value, false); 136 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<unsigned __int64 const volatile>::value, false); 137 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<__int64 const volatile>::value, false); 138 #endif 139 #endif 140 141 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<float>::value, true); 142 #ifndef TEST_STD 143 // unspecified behaviour: 144 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<float const>::value, false); 145 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<float volatile>::value, false); 146 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<float const volatile>::value, false); 147 #endif 148 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<double>::value, true); 149 #ifndef TEST_STD 150 // unspecified behaviour: 151 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<double const>::value, false); 152 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<double volatile>::value, false); 153 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<double const volatile>::value, false); 154 #endif 155 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<long double>::value, true); 156 #ifndef TEST_STD 157 // unspecified behaviour: 158 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<long double const>::value, false); 159 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<long double volatile>::value, false); 160 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<long double const volatile>::value, false); 161 #endif 162 163 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int>::value, true); 164 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<void*>::value, true); 165 #ifndef TEST_STD 166 // unspecified behaviour: 167 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int*const>::value, false); 168 #endif 169 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<f1>::value, true); 170 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<f2>::value, true); 171 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<f3>::value, true); 172 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<mf1>::value, true); 173 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<mf2>::value, true); 174 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<mf3>::value, true); 175 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<mp>::value, true); 176 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<cmf>::value, true); 177 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<enum_UDT>::value, true); 178 179 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int&>::value, false); 180 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES 181 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int&&>::value, false); 182 #endif 183 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<const int&>::value, false); 184 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int[2]>::value, true); 185 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int[3][2]>::value, true); 186 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<int[2][4][5][6][3]>::value, true); 187 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<UDT>::value, false); 188 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<empty_UDT>::value, false); 189 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<void>::value, false); 190 // cases we would like to succeed but can't implement in the language: 191 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<empty_POD_UDT>::value, true, false); 192 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<POD_UDT>::value, true, false); 193 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<POD_union_UDT>::value, true, false); 194 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<empty_POD_union_UDT>::value, true, false); 195 196 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<trivial_except_assign>::value, false); 197 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<trivial_except_destroy>::value, true, false); 198 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<trivial_except_construct>::value, true, false); 199 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<trivial_except_copy>::value, true, false); 200 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<wrap<trivial_except_assign> >::value, false); 201 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<wrap<trivial_except_destroy> >::value, true, false); 202 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<wrap<trivial_except_construct> >::value, true, false); 203 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<wrap<trivial_except_copy> >::value, true, false); 204 205 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign<test_abc1>::value, false); 206 207 TT_TEST_END 208 209 210 -
libs/type_traits/test/has_nothrow_move_constructor_test.cpp
Property changes on: libs/type_traits/test/has_trivial_move_assign_test.cpp ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property
1 2 // (C) Copyright John Maddock 2000. 3 // (C) Copyright Antony Polukhin 2013. 4 // Use, modification and distribution are subject to the 5 // Boost Software License, Version 1.0. (See accompanying file 6 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 8 #include "test.hpp" 9 #include "check_integral_constant.hpp" 10 #ifdef TEST_STD 11 # include <type_traits> 12 #else 13 # include <boost/type_traits/has_nothrow_move_constructor.hpp> 14 #endif 15 16 TT_TEST_BEGIN(has_nothrow_move_constructor) 17 18 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<bool>::value, true); 19 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<bool const>::value, true); 20 #ifndef TEST_STD 21 // unspecified behaviour: 22 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<bool volatile>::value, false); 23 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<bool const volatile>::value, false); 24 #endif 25 26 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<signed char>::value, true); 27 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<signed char const>::value, true); 28 #ifndef TEST_STD 29 // unspecified behaviour: 30 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<signed char volatile>::value, false); 31 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<signed char const volatile>::value, false); 32 #endif 33 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned char>::value, true); 34 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<char>::value, true); 35 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned char const>::value, true); 36 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<char const>::value, true); 37 #ifndef TEST_STD 38 // unspecified behaviour: 39 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned char volatile>::value, false); 40 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<char volatile>::value, false); 41 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned char const volatile>::value, false); 42 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<char const volatile>::value, false); 43 #endif 44 45 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned short>::value, true); 46 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<short>::value, true); 47 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned short const>::value, true); 48 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<short const>::value, true); 49 #ifndef TEST_STD 50 // unspecified behaviour: 51 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned short volatile>::value, false); 52 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<short volatile>::value, false); 53 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned short const volatile>::value, false); 54 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<short const volatile>::value, false); 55 #endif 56 57 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned int>::value, true); 58 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int>::value, true); 59 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned int const>::value, true); 60 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int const>::value, true); 61 #ifndef TEST_STD 62 // unspecified behaviour: 63 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned int volatile>::value, false); 64 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int volatile>::value, false); 65 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned int const volatile>::value, false); 66 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int const volatile>::value, false); 67 #endif 68 69 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned long>::value, true); 70 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<long>::value, true); 71 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned long const>::value, true); 72 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<long const>::value, true); 73 #ifndef TEST_STD 74 // unspecified behaviour: 75 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned long volatile>::value, false); 76 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<long volatile>::value, false); 77 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned long const volatile>::value, false); 78 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<long const volatile>::value, false); 79 #endif 80 81 #ifdef BOOST_HAS_LONG_LONG 82 83 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor< ::boost::ulong_long_type>::value, true); 84 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor< ::boost::long_long_type>::value, true); 85 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor< ::boost::ulong_long_type const>::value, true); 86 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor< ::boost::long_long_type const>::value, true); 87 #ifndef TEST_STD 88 // unspecified behaviour: 89 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor< ::boost::ulong_long_type volatile>::value, false); 90 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor< ::boost::long_long_type volatile>::value, false); 91 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor< ::boost::ulong_long_type const volatile>::value, false); 92 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor< ::boost::long_long_type const volatile>::value, false); 93 #endif 94 #endif 95 96 #ifdef BOOST_HAS_MS_INT64 97 98 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int8>::value, true); 99 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int8>::value, true); 100 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int8 const>::value, true); 101 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int8 const>::value, true); 102 #ifndef TEST_STD 103 // unspecified behaviour: 104 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int8 volatile>::value, false); 105 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int8 volatile>::value, false); 106 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int8 const volatile>::value, false); 107 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int8 const volatile>::value, false); 108 #endif 109 110 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int16>::value, true); 111 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int16>::value, true); 112 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int16 const>::value, true); 113 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int16 const>::value, true); 114 #ifndef TEST_STD 115 // unspecified behaviour: 116 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int16 volatile>::value, false); 117 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int16 volatile>::value, false); 118 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int16 const volatile>::value, false); 119 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int16 const volatile>::value, false); 120 #endif 121 122 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int32>::value, true); 123 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int32>::value, true); 124 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int32 const>::value, true); 125 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int32 const>::value, true); 126 #ifndef TEST_STD 127 // unspecified behaviour: 128 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int32 volatile>::value, false); 129 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int32 volatile>::value, false); 130 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int32 const volatile>::value, false); 131 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int32 const volatile>::value, false); 132 #endif 133 134 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int64>::value, true); 135 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int64>::value, true); 136 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int64 const>::value, true); 137 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int64 const>::value, true); 138 #ifndef TEST_STD 139 // unspecified behaviour: 140 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int64 volatile>::value, false); 141 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int64 volatile>::value, false); 142 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<unsigned __int64 const volatile>::value, false); 143 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<__int64 const volatile>::value, false); 144 #endif 145 #endif 146 147 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<float>::value, true); 148 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<float const>::value, true); 149 #ifndef TEST_STD 150 // unspecified behaviour: 151 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<float volatile>::value, false); 152 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<float const volatile>::value, false); 153 #endif 154 155 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<double>::value, true); 156 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<double const>::value, true); 157 #ifndef TEST_STD 158 // unspecified behaviour: 159 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<double volatile>::value, false); 160 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<double const volatile>::value, false); 161 #endif 162 163 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<long double>::value, true); 164 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<long double const>::value, true); 165 #ifndef TEST_STD 166 // unspecified behaviour: 167 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<long double volatile>::value, false); 168 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<long double const volatile>::value, false); 169 #endif 170 171 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int>::value, true); 172 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<void*>::value, true); 173 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int*const>::value, true); 174 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<f1>::value, true); 175 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<f2>::value, true); 176 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<f3>::value, true); 177 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<mf1>::value, true); 178 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<mf2>::value, true); 179 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<mf3>::value, true); 180 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<mp>::value, true); 181 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<cmf>::value, true); 182 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<enum_UDT>::value, true); 183 184 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int&>::value, false); 185 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES 186 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int&&>::value, false); 187 #endif 188 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<const int&>::value, false); 189 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int[2]>::value, true); 190 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int[3][2]>::value, true); 191 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<int[2][4][5][6][3]>::value, true); 192 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<UDT>::value, false); 193 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<void>::value, false); 194 // cases we would like to succeed but can't implement in the language: 195 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<empty_POD_UDT>::value, true, false); 196 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<POD_UDT>::value, true, false); 197 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<POD_union_UDT>::value, true, false); 198 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<empty_POD_union_UDT>::value, true, false); 199 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<nothrow_copy_UDT>::value, true, false); 200 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<nothrow_assign_UDT>::value, false); 201 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<nothrow_construct_UDT>::value, false); 202 203 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_move_constructor<test_abc1>::value, false); 204 205 TT_TEST_END 206 207 208 -
libs/type_traits/doc/intrinsics.qbk
Property changes on: libs/type_traits/test/has_nothrow_move_constructor_test.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property
10 10 There are some traits that can not be implemented within the current C++ language: 11 11 to make these traits "just work" with user defined types, some kind of additional 12 12 help from the compiler is required. Currently (April 2008) Visual C++ 8 and 9, 13 GNU GCC 4.3 and MWCW 9 14 provide the necessary intrinsics, and other compilers will no doubt follow in due 15 course. 13 GNU GCC 4.3 and MWCW 9 provide at least some of the the necessary intrinsics, 14 and other compilers will no doubt follow in due course. 16 15 17 16 The Following traits classes always need compiler support to do the right thing 18 17 for all types … … 22 21 * __is_pod 23 22 * __has_trivial_constructor 24 23 * __has_trivial_copy 24 * __has_trivial_move_constructor 25 25 * __has_trivial_assign 26 * __has_trivial_move_assign 26 27 * __has_trivial_destructor 27 28 * __has_nothrow_constructor 28 29 * __has_nothrow_copy … … 51 52 [[BOOST_IS_EMPTY(T)][Should evaluate to true if T is an empty struct or union]] 52 53 [[BOOST_HAS_TRIVIAL_CONSTRUCTOR(T)][Should evaluate to true if the default constructor for T is trivial (i.e. has no effect)]] 53 54 [[BOOST_HAS_TRIVIAL_COPY(T)][Should evaluate to true if T has a trivial copy constructor (and can therefore be replaced by a call to memcpy)]] 55 [[BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T)][Should evaluate to true if T has a trivial move constructor (and can therefore be replaced by a call to memcpy)]] 54 56 [[BOOST_HAS_TRIVIAL_ASSIGN(T)][Should evaluate to true if T has a trivial assignment operator (and can therefore be replaced by a call to memcpy)]] 57 [[BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T)][Should evaluate to true if T has a trivial move assignment operator (and can therefore be replaced by a call to memcpy)]] 55 58 [[BOOST_HAS_TRIVIAL_DESTRUCTOR(T)][Should evaluate to true if T has a trivial destructor (i.e. ~T() has no effect)]] 56 59 [[BOOST_HAS_NOTHROW_CONSTRUCTOR(T)][Should evaluate to true if `T x;` can not throw]] 57 60 [[BOOST_HAS_NOTHROW_COPY(T)][Should evaluate to true if `T(t)` can not throw]]