]> git.donarmstrong.com Git - rsem.git/blob - boost/type_traits/is_nothrow_move_constructible.hpp
Updated boost to v1.55.0
[rsem.git] / boost / type_traits / is_nothrow_move_constructible.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_IS_NOTHROW_MOVE_CONSTRUCTIBLE_HPP_INCLUDED
12 #define BOOST_TT_IS_NOTHROW_MOVE_CONSTRUCTIBLE_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/is_array.hpp>
18 #include <boost/type_traits/is_reference.hpp>
19 #include <boost/type_traits/detail/ice_or.hpp>
20 #include <boost/type_traits/detail/ice_and.hpp>
21 #include <boost/utility/declval.hpp>
22 #include <boost/utility/enable_if.hpp>
23
24 // should be the last #include
25 #include <boost/type_traits/detail/bool_trait_def.hpp>
26
27 namespace boost {
28
29 namespace detail{
30
31 #ifndef BOOST_NO_CXX11_NOEXCEPT
32
33 template <class T, class Enable = void>
34 struct false_or_cpp11_noexcept_move_constructible: public ::boost::false_type {};
35
36 template <class T>
37 struct false_or_cpp11_noexcept_move_constructible <
38         T,
39         typename ::boost::enable_if_c<sizeof(T) && BOOST_NOEXCEPT_EXPR(T(::boost::declval<T>()))>::type
40     > : public ::boost::integral_constant<bool, BOOST_NOEXCEPT_EXPR(T(::boost::declval<T>()))>
41 {};
42
43 template <class T>
44 struct is_nothrow_move_constructible_imp{
45    BOOST_STATIC_CONSTANT(bool, value = 
46         (::boost::type_traits::ice_and<
47             ::boost::type_traits::ice_not< ::boost::is_volatile<T>::value >::value,
48             ::boost::type_traits::ice_not< ::boost::is_reference<T>::value >::value,
49             ::boost::detail::false_or_cpp11_noexcept_move_constructible<T>::value
50         >::value));
51 };
52
53 #else
54
55 template <class T>
56 struct is_nothrow_move_constructible_imp{
57     BOOST_STATIC_CONSTANT(bool, value =(
58         ::boost::type_traits::ice_and<
59             ::boost::type_traits::ice_or<
60                 ::boost::has_trivial_move_constructor<T>::value,
61                 ::boost::has_nothrow_copy<T>::value
62             >::value,
63             ::boost::type_traits::ice_not< ::boost::is_array<T>::value >::value
64         >::value));
65 };
66
67 #endif
68
69 }
70
71 BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_nothrow_move_constructible,T,::boost::detail::is_nothrow_move_constructible_imp<T>::value)
72
73 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_constructible,void,false)
74 #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
75 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_constructible,void const,false)
76 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_constructible,void const volatile,false)
77 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_constructible,void volatile,false)
78 #endif
79
80 } // namespace boost
81
82 #include <boost/type_traits/detail/bool_trait_undef.hpp>
83
84 #endif // BOOST_TT_IS_NOTHROW_MOVE_CONSTRUCTIBLE_HPP_INCLUDED